Skip to content

Commit c547879

Browse files
committed
clangd: Add a build option to disable building dexp
Building dexp on Debian 11 currently causes intermittent failure[0][1]. Adding the CLANGD_BUILD_DEXP option to disable dexp from the build allows Debian 11 users to build clang (albeit without the dexp tool). This option is set to "Build Dexp" by default so, no change is expected without manual setting. [0]: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15803 [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1101322
1 parent e6dda9c commit c547879

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

clang-tools-extra/clangd/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,8 @@ option(CLANGD_ENABLE_REMOTE "Use gRPC library to enable remote index support for
220220
set(GRPC_INSTALL_PATH "" CACHE PATH "Path to gRPC library manual installation.")
221221

222222
add_subdirectory(index/remote)
223-
add_subdirectory(index/dex/dexp)
223+
224+
option(CLANGD_BUILD_DEXP "Build the dexp tool as part of Clangd" ON)
225+
if(CLANGD_BUILD_DEXP)
226+
add_subdirectory(index/dex/dexp)
227+
endif()

clang-tools-extra/clangd/test/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ set(CLANGD_TEST_DEPS
33
ClangdTests
44
clangd-indexer
55
split-file
6-
# No tests for it, but we should still make sure they build.
7-
dexp
86
)
97

108
if(CLANGD_BUILD_XPC)
119
list(APPEND CLANGD_TEST_DEPS clangd-xpc-test-client)
1210
list(APPEND CLANGD_TEST_DEPS ClangdXpcUnitTests)
1311
endif()
1412

13+
if(CLANGD_BUILD_DEXP)
14+
# No tests for it, but we should still make sure they build.
15+
list(APPEND CLANGD_TEST_DEPS dexp)
16+
endif()
17+
1518
if(CLANGD_ENABLE_REMOTE)
1619
list(APPEND CLANGD_TEST_DEPS clangd-index-server clangd-index-server-monitor)
1720
endif()

clang-tools-extra/clangd/test/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ config.llvm_shlib_dir = "@SHLIBDIR@"
1515
config.clangd_source_dir = "@CMAKE_CURRENT_SOURCE_DIR@/.."
1616
config.clangd_binary_dir = "@CMAKE_CURRENT_BINARY_DIR@/.."
1717
config.clangd_build_xpc = @CLANGD_BUILD_XPC@
18+
config.clangd_build_dexp = @CLANGD_BUILD_DEXP@
1819
config.clangd_enable_remote = @CLANGD_ENABLE_REMOTE@
1920
config.clangd_tidy_checks = @CLANGD_TIDY_CHECKS@
2021
config.have_zlib = @LLVM_ENABLE_ZLIB@

llvm/utils/gn/secondary/clang-tools-extra/clangd/test/BUILD.gn

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ group("test") {
7777
deps = [
7878
":lit_site_cfg",
7979
":lit_unit_site_cfg",
80-
"//clang-tools-extra/clangd/index/dex/dexp",
8180
"//clang-tools-extra/clangd/indexer:clangd-indexer",
8281
"//clang-tools-extra/clangd/tool:clangd",
8382
"//clang-tools-extra/clangd/unittests:ClangdTests",
@@ -92,6 +91,11 @@ group("test") {
9291
"//clang-tools-extra/clangd/xpc/test-client:clangd-xpc-test-client",
9392
]
9493
}
94+
if (clangd_build_dexp) {
95+
deps += [
96+
"//clang-tools-extra/clangd/index/dex/dexp",
97+
]
98+
}
9599
testonly = true
96100
}
97101

0 commit comments

Comments
 (0)