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: refresh_compile_commands.bzl
+21-1Lines changed: 21 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,12 @@ refresh_compile_commands(
49
49
# exclude_headers = "external",
50
50
# Still not fast enough?
51
51
# Make sure you're specifying just the targets you care about by setting `targets`, above.
52
+
53
+
# refresh_compile_commands will automatically update .git/info/exclude by default.
54
+
# You can disable this behavior with update_gitignore = False.
55
+
56
+
# refresh_compile_commands will automatically create a symlink for external workspaces at /external.
57
+
# You can disable this behavior with link_external = False.
52
58
```
53
59
"""
54
60
@@ -63,6 +69,8 @@ def refresh_compile_commands(
63
69
targets=None,
64
70
exclude_headers=None,
65
71
exclude_external_sources=False,
72
+
update_gitignore=True,
73
+
link_external=True,
66
74
**kwargs): # For the other common attributes. Tags, compatible_with, etc. https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes.
67
75
# Convert the various, acceptable target shorthands into the dictionary format
68
76
# 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.
@@ -88,7 +96,15 @@ def refresh_compile_commands(
88
96
89
97
# Generate the core, runnable python script from refresh.template.py
" {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
# 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
129
149
# Once https://github.com/bazelbuild/bazel/pull/17108 is widely released, we should be able to eliminate this and get INCLUDE directly. Perhaps for 7.0? Should be released in the sucessor to 6.0
0 commit comments