Skip to content
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

[tools]: fix the issue of missing commands in compile_commands.json #9856

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,11 @@ def local_group(group, objects):

break
else:
# generate build/compile_commands.json
if GetOption('cdb') and utils.VerTuple(SCons.__version__) >= (4, 0, 0):
Env.Tool("compilation_db")
Env.CompilationDatabase('build/compile_commands.json')
supperthomas marked this conversation as resolved.
Show resolved Hide resolved

# remove source files with local flags setting
for group in Projects:
if 'LOCAL_CFLAGS' in group or 'LOCAL_CXXFLAGS' in group or 'LOCAL_CCFLAGS' in group or 'LOCAL_CPPPATH' in group or 'LOCAL_CPPDEFINES' in group:
Expand All @@ -843,11 +848,6 @@ def local_group(group, objects):
objects = sorted(objects)
objects.append(objects_in_group)

# generate build/compile_commands.json
if GetOption('cdb') and utils.VerTuple(SCons.__version__) >= (4, 0, 0):
Env.Tool("compilation_db")
Env.CompilationDatabase('build/compile_commands.json')

program = Env.Program(target, objects)

EndBuilding(target, program)
Expand Down
Loading