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