| 1 |
set(LLVM_LINK_COMPONENTS |
| 2 |
FrontendOpenMP |
| 3 |
Support |
| 4 |
) |
| 5 |
|
| 6 |
configure_file( |
| 7 |
${CMAKE_CURRENT_SOURCE_DIR}/clang-tidy-config.h.cmake |
| 8 |
${CMAKE_CURRENT_BINARY_DIR}/clang-tidy-config.h) |
| 9 |
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) |
| 10 |
|
| 11 |
add_clang_library(clangTidy |
| 12 |
ClangTidy.cpp |
| 13 |
ClangTidyCheck.cpp |
| 14 |
ClangTidyModule.cpp |
| 15 |
ClangTidyDiagnosticConsumer.cpp |
| 16 |
ClangTidyOptions.cpp |
| 17 |
ClangTidyProfiling.cpp |
| 18 |
ExpandModularHeadersPPCallbacks.cpp |
| 19 |
GlobList.cpp |
| 20 |
NoLintDirectiveHandler.cpp |
| 21 |
|
| 22 |
DEPENDS |
| 23 |
ClangSACheckers |
| 24 |
omp_gen |
| 25 |
) |
| 26 |
|
| 27 |
clang_target_link_libraries(clangTidy |
| 28 |
PRIVATE |
| 29 |
clangAnalysis |
| 30 |
clangAST |
| 31 |
clangASTMatchers |
| 32 |
clangBasic |
| 33 |
clangFormat |
| 34 |
clangFrontend |
| 35 |
clangLex |
| 36 |
clangRewrite |
| 37 |
clangSema |
| 38 |
clangSerialization |
| 39 |
clangTooling |
| 40 |
clangToolingCore |
| 41 |
) |
| 42 |
|
| 43 |
if(CLANG_TIDY_ENABLE_STATIC_ANALYZER) |
| 44 |
clang_target_link_libraries(clangTidy |
| 45 |
PRIVATE |
| 46 |
clangStaticAnalyzerCore |
| 47 |
clangStaticAnalyzerFrontend |
| 48 |
) |
| 49 |
endif() |
| 50 |
|
| 51 |
# Checks. |
| 52 |
# If you add a check, also add it to ClangTidyForceLinker.h in this directory. |
| 53 |
add_subdirectory(android) |
| 54 |
add_subdirectory(abseil) |
| 55 |
add_subdirectory(altera) |
| 56 |
add_subdirectory(boost) |
| 57 |
add_subdirectory(bugprone) |
| 58 |
add_subdirectory(cert) |
| 59 |
add_subdirectory(concurrency) |
| 60 |
add_subdirectory(cppcoreguidelines) |
| 61 |
add_subdirectory(darwin) |
| 62 |
add_subdirectory(fuchsia) |
| 63 |
add_subdirectory(google) |
| 64 |
add_subdirectory(hicpp) |
| 65 |
add_subdirectory(linuxkernel) |
| 66 |
add_subdirectory(llvm) |
| 67 |
add_subdirectory(llvmlibc) |
| 68 |
add_subdirectory(misc) |
| 69 |
add_subdirectory(modernize) |
| 70 |
if(CLANG_TIDY_ENABLE_STATIC_ANALYZER) |
| 71 |
add_subdirectory(mpi) |
| 72 |
endif() |
| 73 |
add_subdirectory(objc) |
| 74 |
add_subdirectory(openmp) |
| 75 |
add_subdirectory(performance) |
| 76 |
add_subdirectory(portability) |
| 77 |
add_subdirectory(readability) |
| 78 |
add_subdirectory(zircon) |
| 79 |
set(ALL_CLANG_TIDY_CHECKS |
| 80 |
clangTidyAndroidModule |
| 81 |
clangTidyAbseilModule |
| 82 |
clangTidyAlteraModule |
| 83 |
clangTidyBoostModule |
| 84 |
clangTidyBugproneModule |
| 85 |
clangTidyCERTModule |
| 86 |
clangTidyConcurrencyModule |
| 87 |
clangTidyCppCoreGuidelinesModule |
| 88 |
clangTidyDarwinModule |
| 89 |
clangTidyFuchsiaModule |
| 90 |
clangTidyGoogleModule |
| 91 |
clangTidyHICPPModule |
| 92 |
clangTidyLinuxKernelModule |
| 93 |
clangTidyLLVMModule |
| 94 |
clangTidyLLVMLibcModule |
| 95 |
clangTidyMiscModule |
| 96 |
clangTidyModernizeModule |
| 97 |
clangTidyObjCModule |
| 98 |
clangTidyOpenMPModule |
| 99 |
clangTidyPerformanceModule |
| 100 |
clangTidyPortabilityModule |
| 101 |
clangTidyReadabilityModule |
| 102 |
clangTidyZirconModule |
| 103 |
) |
| 104 |
if(CLANG_TIDY_ENABLE_STATIC_ANALYZER) |
| 105 |
list(APPEND ALL_CLANG_TIDY_CHECKS clangTidyMPIModule) |
| 106 |
endif() |
| 107 |
set(ALL_CLANG_TIDY_CHECKS ${ALL_CLANG_TIDY_CHECKS} PARENT_SCOPE) |
| 108 |
|
| 109 |
# Other subtargets. These may reference ALL_CLANG_TIDY_CHECKS |
| 110 |
# and must be below its definition. |
| 111 |
add_subdirectory(plugin) |
| 112 |
add_subdirectory(tool) |
| 113 |
add_subdirectory(utils) |
| 114 |
|
| 115 |
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) |
| 116 |
install(DIRECTORY . |
| 117 |
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/clang-tidy" |
| 118 |
COMPONENT clang-tidy-headers |
| 119 |
FILES_MATCHING |
| 120 |
PATTERN "*.h" |
| 121 |
) |
| 122 |
add_custom_target(clang-tidy-headers) |
| 123 |
set_target_properties(clang-tidy-headers PROPERTIES FOLDER "Misc") |
| 124 |
if(NOT LLVM_ENABLE_IDE) |
| 125 |
add_llvm_install_targets(install-clang-tidy-headers |
| 126 |
DEPENDS clang-tidy-headers |
| 127 |
COMPONENT clang-tidy-headers) |
| 128 |
endif() |
| 129 |
endif() |