You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .gitignore
+2
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,5 @@
3
3
4
4
# Ignore links to Bazel's output. The pattern needs the `*` because people can change the name of the directory into which the repository is cloned (changing the `bazel-<workspace_name>` symlink), and must not end with a trailing `/` because it's a symlink on macOS/Linux.
# For example, `d_file_content` might be: `"foo.o : foo.cc bar.h \\\n baz.hpp"`.
174
174
target, dependencies=d_file_content.split(': ', 1) # Needs to handle absolute Windows paths, like C:\
175
175
target=target.strip() # Remove the optional trailing space.
176
-
asserttarget.endswith(('.o', '.obj', '.processed')), "Something went wrong in makefile parsing to get headers. The target should be an object file. Output:\n"+d_file_content
176
+
asserttarget.endswith(_get_headers.output_extensions), "Something went wrong in makefile parsing to get headers. The target should be an object file. Output:\n"+d_file_content
177
177
# 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.
178
178
dependencies=dependencies.replace('\\\n', '')
179
179
# 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
# Strip sanitizer ignore lists...so they don't show up in the dependency list.
273
273
# See https://clang.llvm.org/docs/SanitizerSpecialCaseList.html and https://github.com/hedronvision/bazel-compile-commands-extractor/issues/34 for more context.
274
274
header_cmd= (argforarginheader_cmd
275
275
ifnotarg.startswith('-fsanitize'))
276
276
277
+
# Strip syntax-only option since it is ignored when running pre-processor only, and will create noisy warnings.
278
+
header_cmd= (argforarginheader_cmd
279
+
ifnotarg.startswith('-fsyntax-only'))
280
+
277
281
# Dump system and user headers to stdout...in makefile format.
278
282
# Relies on our having made the workspace directory simulate a complete version of the execroot with //external symlink
'/EP', # Preprocess (only, no compilation for speed), writing to stdout where we can easily ignore it instead of a file. https://docs.microsoft.com/en-us/cpp/build/reference/ep-preprocess-to-stdout-without-hash-line-directives
423
427
]
424
428
429
+
# Strip syntax-only (/Zs) option since it is ignored when running pre-processor only, and will create noisy warnings.
430
+
header_cmd= (argforarginheader_cmdifarg!='/Zs')
431
+
425
432
# cl.exe needs the `INCLUDE` environment variable to find the system headers, since they aren't specified in the action command
426
433
# Bazel neglects to include INCLUDE per action, so we'll do the best we can and infer them from the default (host) cc toolchain.
427
434
# These are set in https://github.com/bazelbuild/bazel/bloc/master/tools/cpp/windows_cc_configure.bzl. Search INCLUDE.
0 commit comments