Handle generated files by cmake - #19
Merged
Merged
Conversation
ekacnet
commented
May 2, 2026
Owner
- Add posttreatments option
- Add another post treatment for generating ProtocolVersion from cmakke templates
- Generate load instruction for macros that are used related to cc_library, sh_binary ...
- Add support for generating pregenerated files
- Allow to provide some placeholders on the cli too
- Add tool to post process bazel file from ninja2bazel to make it more useful
- Deal with subfolders for configure_file
- Generate some vars like CMAKE_SOURCE_DIR automatically
- Move renderconfig to the target tree if needed
- Deal with #cmakedefine values
- ** Do not parse env_set as set**
- Propagate the dependencies found in files generated to the target that use the generated files
- Refactor how we discover that the command to run for genrule is python based
- Do not add blindly deps for a genrule target as sources
- Add .s/.S (assembly) that are generated to the sources rather than data.
ekacnet
force-pushed
the
dev/handlegeneratingpregenerated
branch
from
May 2, 2026 22:08
0b736d3 to
a610d96
Compare
ekacnet
force-pushed
the
dev/handlegeneratingpregenerated
branch
from
May 3, 2026 16:54
a610d96 to
479952d
Compare
ekacnet
force-pushed
the
dev/handlegeneratingpregenerated
branch
from
May 3, 2026 18:23
479952d to
1d4bf75
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19 +/- ##
==========================================
+ Coverage 74.19% 77.36% +3.17%
==========================================
Files 20 23 +3
Lines 3790 4582 +792
==========================================
+ Hits 2812 3545 +733
- Misses 978 1037 +59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ekacnet
force-pushed
the
dev/handlegeneratingpregenerated
branch
from
May 3, 2026 18:27
1d4bf75 to
fe514e4
Compare
Post treatment is to allow a custom per project treatment to manipulate the resulting BUILD file
…ary, sh_binary ...
This might sound counter-intuitive but we might want to generate pre-generated files ie the one that that are generated by cmake instead by the build. Why ? because it is a pain to have to copy the files all the time and keep them in sync as code change.
Sometime the file is an subfolder so ${CMAKE_CURRENT_BINARY_DIR} points
to the folder in the work dir + the subfolder but we didn't handle that
before
…t use the generated files
…n based This relies on better detecting the binary for python + also detecting the argument to the python script.
When processsing the target we already parse through its sources output and tools so we don't need to redo it
ekacnet
force-pushed
the
dev/handlegeneratingpregenerated
branch
from
May 3, 2026 18:30
fe514e4 to
55d7948
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.