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

waf: append new commands on files to compile_commands.json if different arguments are used #29154

Closed
Changes from all commits
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
7 changes: 4 additions & 3 deletions Tools/ardupilotwaf/ap_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ def write_compilation_database(bld):
root = database_file.read_json()
except IOError:
root = []
compile_cmd_db = dict((x['file'], x) for x in root)
for task in bld.compilation_database_tasks:
try:
cmd = task.last_cmd
Expand All @@ -342,8 +341,10 @@ def write_compilation_database(bld):
"arguments": cmd,
"file": filename,
}
compile_cmd_db[filename] = entry
root = list(compile_cmd_db.values())
# check if the entry is already in the database
if entry in root:
continue
root.append(entry)
database_file.write_json(root)

def target_list_changed(bld, targets):
Expand Down
Loading