Fix ewp_parser to work with CppCheck and Clangd

This commit is contained in:
Julien LE PAGE 2023-11-30 16:26:37 +01:00
parent 422697765b
commit db65c042a8

View File

@ -142,15 +142,21 @@ def generate_compile_commands(output_file, root_path, options, files):
:param options: a list of the compilation options
: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:
commands = []
for file in files:
commands.append(
{"directory": root_path, "arguments": options, "file": file})
{"directory": root_path, "arguments": fixed_options, "file": file})
json.dump(commands, output, indent=True)
def normalize_path(path):
"""
Normalizes the given path. Handles mixed-convention paths (dos/unix), which