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