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
Try adding them as flags in your refresh_compile_commands rather than targets.
918
918
In a moment, Bazel will likely fail to parse.""")
919
919
920
-
support_mnemonics= ["Objc", "Cpp"]
921
-
if {enable_swift}:
922
-
support_mnemonics+= ["Swift"]
923
-
mnemonics_string='|'.join(support_mnemonics)
924
-
925
920
# First, query Bazel's C-family compile actions for that configured target
926
921
aquery_args= [
927
922
'bazel',
928
923
'aquery',
929
924
# Aquery docs if you need em: https://docs.bazel.build/versions/master/aquery.html
930
925
# Aquery output proto reference: https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/analysis_v2.proto
931
926
# One bummer, not described in the docs, is that aquery filters over *all* actions for a given target, rather than just those that would be run by a build to produce a given output. This mostly isn't a problem, but can sometimes surface extra, unnecessary, misconfigured actions. Chris has emailed the authors to discuss and filed an issue so anyone reading this could track it: https://github.com/bazelbuild/bazel/issues/14156.
# We switched to jsonproto instead of proto because of https://github.com/bazelbuild/bazel/issues/13404. We could change back when fixed--reverting most of the commit that added this line and tweaking the build file to depend on the target in that issue. That said, it's kinda nice to be free of the dependency, unless (OPTIMNOTE) jsonproto becomes a performance bottleneck compated to binary protos.
934
929
'--output=jsonproto',
935
930
# We'll disable artifact output for efficiency, since it's large and we don't use them. Small win timewise, but dramatically less json output from aquery.
Copy file name to clipboardExpand all lines: refresh_compile_commands.bzl
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ def refresh_compile_commands(
63
63
targets=None,
64
64
exclude_headers=None,
65
65
exclude_external_sources=False,
66
-
enable_swift=False,
66
+
exclude_swift=False,
67
67
**kwargs): # For the other common attributes. Tags, compatible_with, etc. https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes.
68
68
# Convert the various, acceptable target shorthands into the dictionary format
69
69
# In Python, `type(x) == y` is an antipattern, but [Starlark doesn't support inheritance](https://bazel.build/rules/language), so `isinstance` doesn't exist, and this is the correct way to switch on type.
" {windows_default_include_paths}": "\n".join([" %r,"%pathforpathinfind_cpp_toolchain(ctx).built_in_include_directories]), # find_cpp_toolchain is from https://docs.bazel.build/versions/main/integrating-with-rules-cc.html
"_cc_toolchain": attr.label(default="@bazel_tools//tools/cpp:current_cc_toolchain"), # For Windows INCLUDE. If this were eliminated, for example by the resolution of https://github.com/clangd/clangd/issues/123, we'd be able to just use a macro and skylib's expand_template rule: https://github.com/bazelbuild/bazel-skylib/pull/330
0 commit comments