Showcase new method for compile commands generation#172
Draft
furtib wants to merge 1 commit intoEricsson:mainfrom
Draft
Showcase new method for compile commands generation#172furtib wants to merge 1 commit intoEricsson:mainfrom
furtib wants to merge 1 commit intoEricsson:mainfrom
Conversation
ecaf3bc to
9460544
Compare
nettle
reviewed
Jan 29, 2026
Comment on lines
+302
to
+308
| # from: https://github.com/thekyz/snippets/tree/master/compilation_command_aspects | ||
| for action in target.actions: | ||
| if action.mnemonic == 'CppCompile': | ||
| for input in action.inputs.to_list(): | ||
| if input.extension == 'c' or input.extension == 'cpp': | ||
| break | ||
| print(target, action.argv) |
Collaborator
There was a problem hiding this comment.
Not quite sure I understand the purpose of this so far...
Do you mean that there is simpler way of collecting source:arguments?
If so we should consider it and compare with existing one.
That might be interesting!
Contributor
Author
There was a problem hiding this comment.
Yes, that is exactly it! I think we should see how this compares to our solution.
I'm not 100% sure this method is better, but this example, if run, prints out all build commands, even those hidden under implementation_deps, without looping over attributes. It seems very promising.
I just wanted to bring this to our attention and have it documented so we can reference it in the future.
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.
Why:
I have come across this seemingly superior method for generating
compile_commands.jsonWhat:
Note:
Addresses:
none