Skip to content

Commit f92c74c

Browse files
DavidSpickettHoney Goyal
authored andcommitted
[clang] Only build c-index-test and apinotes-test when clang tests are included (llvm#151157)
Those programs are only used for testing, and it's used in tests that are already guarded by CLANG_INCLUDE_TESTS in clang/CMakeLists.txt. This change enables us to do builds with LLVM_INSTALL_TOOLCHAIN_ONLY=OFF, and CLANG_INCLUDE_TESTS=OFF, which contain the required files to build other bits of llvm-project standalone, but do not include those unnecessary testing programs.
1 parent f691e30 commit f92c74c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/tools/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ create_subdirectory_options(CLANG TOOL)
22

33
add_clang_subdirectory(diagtool)
44
add_clang_subdirectory(driver)
5-
add_clang_subdirectory(apinotes-test)
65
if(CLANG_ENABLE_CIR)
76
add_clang_subdirectory(cir-opt)
87
add_clang_subdirectory(cir-translate)
@@ -22,7 +21,10 @@ if(HAVE_CLANG_REPL_SUPPORT)
2221
add_clang_subdirectory(clang-repl)
2322
endif()
2423

25-
add_clang_subdirectory(c-index-test)
24+
if(CLANG_INCLUDE_TESTS)
25+
add_clang_subdirectory(c-index-test)
26+
add_clang_subdirectory(apinotes-test)
27+
endif()
2628

2729
add_clang_subdirectory(clang-refactor)
2830
# For MinGW/Cygwin we only enable shared library if LLVM_LINK_LLVM_DYLIB=ON.

0 commit comments

Comments
 (0)