Skip to content

Commit dd5a79e

Browse files
authored
Fix: assertion when using zig toolchain
The zig toolchain uses the file extension .obj instead of .o
1 parent 199ca85 commit dd5a79e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

refresh.template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def _parse_headers_from_makefile_deps(d_file_content: str, source_path_for_sanit
163163
# For example, `d_file_content` might be: `"foo.o : foo.cc bar.h \\\n baz.hpp"`.
164164
target, dependencies = d_file_content.split(':', 1)
165165
target = target.strip() # Remove the optional trailing space.
166-
assert target.endswith('.o'), "Something went wrong in makefile parsing to get headers. The target should be an object file. Output:\n" + d_file_content
166+
assert target.endswith(('.o', '.obj')), "Something went wrong in makefile parsing to get headers. The target should be an object file. Output:\n" + d_file_content
167167
# Undo shell-like line wrapping because the newlines aren't eaten by shlex.join. Note also that it's the line wrapping is inconsistently generated across compilers and depends on the lengths of the filenames, so you can't just split on the escaped newlines.
168168
dependencies = dependencies.replace('\\\n', '')
169169
# On Windows, swap out (single) backslash path directory separators for forward slash. Shlex otherwise eats the separators...and Windows gcc intermixes backslash separators with backslash escaped spaces. For a real example of gcc run from Windows, see https://github.com/hedronvision/bazel-compile-commands-extractor/issues/81

0 commit comments

Comments
 (0)