Skip to content

Commit 143cf1a

Browse files
committed
[bazel] Generate a shim Features.inc
This is a quick fix to make the bzl build work w/ this change. The sources included in the cc_library don't actually need the values here. Before adding more files, this should be replaced with something that actually parses Features.inc.in and sets configurable values.
1 parent 102273a commit 143cf1a

File tree

1 file changed

+20
-0
lines changed
  • utils/bazel/llvm-project-overlay/clang-tools-extra/clangd

1 file changed

+20
-0
lines changed

utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,30 @@ package(
99

1010
licenses(["notice"])
1111

12+
# TODO: this is a shim to provide Features.inc as needed by Feature.h.
13+
# Replace this with something that parses Features.inc.in.
14+
genrule(
15+
name = "gen_features_inc",
16+
outs = ["Features.inc"],
17+
cmd = "\n".join([
18+
"echo '// IWYU pragma: private, include \"Feature.h\"' >> $@",
19+
"echo '#define CLANGD_BUILD_XPC 0' >> $@",
20+
"echo '#define CLANGD_ENABLE_REMOTE 1' >> $@",
21+
"echo '#define ENABLE_GRPC_REFLECTION 0' >> $@",
22+
"echo '#define CLANGD_MALLOC_TRIM 0' >> $@",
23+
"echo '#define CLANGD_TIDY_CHECKS 1' >> $@",
24+
"echo '#define CLANGD_DECISION_FOREST 1' >> $@",
25+
]),
26+
)
27+
1228
# TODO: Pick up other files for more complete functionality, to match
1329
# clangd/CMakeLists.txt. This might look something like
1430
# glob(["*.cpp", "dir/**/*.cpp", ...]).
1531
cc_library(
1632
name = "ClangDaemon",
1733
srcs = [
34+
"Feature.cpp",
35+
"Features.inc",
1836
"JSONTransport.cpp",
1937
"Protocol.cpp",
2038
"URI.cpp",
@@ -28,6 +46,7 @@ cc_library(
2846
"support/Trace.cpp",
2947
],
3048
hdrs = [
49+
"Feature.h",
3150
"LSPBinder.h",
3251
"Protocol.h",
3352
"Transport.h",
@@ -47,5 +66,6 @@ cc_library(
4766
"//clang:basic",
4867
"//clang:index",
4968
"//llvm:Support",
69+
"//llvm:TargetParser",
5070
],
5171
)

0 commit comments

Comments
 (0)