-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to generate compile_commands.json using bear #4463
Conversation
src/Makefile.in
Outdated
$(MAKE) -C obj_opt -j 1 TGT=../$@ -f ../Makefile_obj serial | ||
$(MAKE) -C obj_opt TGT=../$@ -f ../Makefile_obj | ||
$(RM_OBJ_OPT_COMPILE_COMMANDS) | ||
$(BEAR_OBJ_OPT) $(MAKE) -C obj_opt -j 1 TGT=../$@ -f ../Makefile_obj serial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if the submakes do nothing, does this break? #4228 (comment)
I'm not sure what you meant by this. Could you please elaborate?
If you meant that there will be wrong compile_commands.json
file when bear will ran on already built target, I've fixed this case. We didn't need to remove compile_commands.json
file before generating it again, as we pass --append
flag to bear
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, seems reasonable. Please make sure "lint-py" is clean (if you didn't already), and update docs/install.rst to mention installing bear for developers.
Also please merge in master to cleanup the test failure - sorry about that instability. |
I'm curious why we use the opt build for the compile_commands.json? Generally the dbg build has "more stuff" in it, like assertions and debug checks, which are compiled out of the opt build. I have been using the commands from the dbg build for IDE use for a long time as it has the right defines for working on debug code as well. |
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
98f99eb
to
d2d14da
Compare
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
I've checked "lint-py" and it is clean. I've also added bear to install.rst.
For our usage opt build had all necessary defines, but dbg have them too. |
Pre-PR to: #4228
This PR adds support for
compile_commands.json
toclang_check_attributes
as well as automatically generatescompile_commands.json
usingbear
(if found).