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

Fix compile_commands.json #3538

Merged
merged 1 commit into from
May 5, 2023
Merged
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
12 changes: 9 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,13 @@ def insert_join(match):
output += lines[idx] + "\n"
idx += 1

return self.join_pattern.sub(insert_join, self.value_pattern.sub(insert_value, output)) + '\n'
output = self.join_pattern.sub(insert_join, self.value_pattern.sub(insert_value, output))

# Prevent newlines being added if the template was not a multiline string
if len(lines) == 1 and not template.endswith('\n'):
return output.rstrip('\n')

return output

try:
return SimpleTemplate(variables).substitute(template_text)
Expand Down Expand Up @@ -2064,7 +2070,7 @@ def choose_cxx_exe():
if options.compiler_cache is None:
return cxx
else:
return '%s %s' % (options.compiler_cache, cxx)
return '%s %s' % (normalize_source_path(options.compiler_cache), cxx)

def extra_libs(libs, cc):
if libs is None:
Expand Down Expand Up @@ -2102,7 +2108,7 @@ def test_exe_extra_ldflags():
'internal_headers': sorted([os.path.basename(h) for h in build_paths.internal_headers]),
'external_headers': sorted([os.path.basename(h) for h in build_paths.external_headers]),

'abs_root_dir': os.path.dirname(os.path.realpath(__file__)),
'abs_root_dir': normalize_source_path(os.path.dirname(os.path.realpath(__file__))),

'base_dir': source_paths.base_dir,
'src_dir': source_paths.src_dir,
Expand Down