Fix ewp_parser to work with CppCheck and Clangd
This commit is contained in:
parent
422697765b
commit
db65c042a8
@ -142,15 +142,21 @@ def generate_compile_commands(output_file, root_path, options, files):
|
|||||||
:param options: a list of the compilation options
|
:param options: a list of the compilation options
|
||||||
:param files: a list of files
|
:param files: a list of files
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
#Compile command implementations seem to have issues ready properly the first
|
||||||
|
#argument, so we add a dummy one as a workaround. Seen with CppCheck and
|
||||||
|
#Clangd
|
||||||
|
fixed_options = [""]
|
||||||
|
fixed_options += options
|
||||||
|
|
||||||
with open(output_file, "w") as output:
|
with open(output_file, "w") as output:
|
||||||
commands = []
|
commands = []
|
||||||
for file in files:
|
for file in files:
|
||||||
commands.append(
|
commands.append(
|
||||||
{"directory": root_path, "arguments": options, "file": file})
|
{"directory": root_path, "arguments": fixed_options, "file": file})
|
||||||
|
|
||||||
json.dump(commands, output, indent=True)
|
json.dump(commands, output, indent=True)
|
||||||
|
|
||||||
|
|
||||||
def normalize_path(path):
|
def normalize_path(path):
|
||||||
"""
|
"""
|
||||||
Normalizes the given path. Handles mixed-convention paths (dos/unix), which
|
Normalizes the given path. Handles mixed-convention paths (dos/unix), which
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user