| 1 |
set(LLVM_SUBPROJECT_TITLE "Clang Tools Extra") |
| 2 |
|
| 3 |
include(CMakeDependentOption) |
| 4 |
include(GNUInstallDirs) |
| 5 |
|
| 6 |
option(CLANG_TIDY_ENABLE_STATIC_ANALYZER |
| 7 |
"Include static analyzer checks in clang-tidy" ON) |
| 8 |
|
| 9 |
if(CLANG_INCLUDE_TESTS) |
| 10 |
umbrella_lit_testsuite_begin(check-clang-tools) |
| 11 |
|
| 12 |
option(CLANG_TOOLS_TEST_USE_VG "Run Clang tools' tests under Valgrind" OFF) |
| 13 |
if(CLANG_TOOLS_TEST_USE_VG) |
| 14 |
set_property(GLOBAL APPEND PROPERTY LLVM_CLANG_TOOLS_LIT_EXTRA_ARGS "--vg") |
| 15 |
endif() |
| 16 |
endif() |
| 17 |
|
| 18 |
add_subdirectory(clang-apply-replacements) |
| 19 |
add_subdirectory(clang-reorder-fields) |
| 20 |
add_subdirectory(modularize) |
| 21 |
add_subdirectory(clang-tidy) |
| 22 |
|
| 23 |
add_subdirectory(clang-change-namespace) |
| 24 |
add_subdirectory(clang-doc) |
| 25 |
add_subdirectory(clang-include-fixer) |
| 26 |
add_subdirectory(clang-move) |
| 27 |
add_subdirectory(clang-query) |
| 28 |
add_subdirectory(include-cleaner) |
| 29 |
add_subdirectory(pp-trace) |
| 30 |
add_subdirectory(pseudo) |
| 31 |
add_subdirectory(tool-template) |
| 32 |
|
| 33 |
option(CLANG_TOOLS_EXTRA_INCLUDE_DOCS "Generate build targets for the Clang Extra Tools docs." |
| 34 |
${LLVM_INCLUDE_DOCS}) |
| 35 |
if( CLANG_TOOLS_EXTRA_INCLUDE_DOCS ) |
| 36 |
add_subdirectory(docs) |
| 37 |
endif() |
| 38 |
|
| 39 |
# clangd has its own CMake tree. It requires threads. |
| 40 |
CMAKE_DEPENDENT_OPTION(CLANG_ENABLE_CLANGD "Build clangd language server" ON |
| 41 |
"LLVM_ENABLE_THREADS" OFF) |
| 42 |
if (CLANG_ENABLE_CLANGD) |
| 43 |
add_subdirectory(clangd) |
| 44 |
endif() |
| 45 |
|
| 46 |
# Add the common testsuite after all the tools. |
| 47 |
if(CLANG_INCLUDE_TESTS) |
| 48 |
add_subdirectory(test) |
| 49 |
add_subdirectory(unittests) |
| 50 |
umbrella_lit_testsuite_end(check-clang-tools) |
| 51 |
endif() |