1set(LLVM_LINK_COMPONENTS 2 AllTargetsAsmParsers 3 AllTargetsDescs 4 AllTargetsInfos 5 FrontendOpenMP 6 TargetParser 7 support 8 ) 9 10# Needed by LLVM's CMake checks because this file defines multiple targets. 11set(LLVM_OPTIONAL_SOURCES ClangTidyMain.cpp ClangTidyToolMain.cpp) 12 13add_clang_library(clangTidyMain STATIC 14 ClangTidyMain.cpp 15 16 LINK_LIBS 17 clangTidy 18 ${ALL_CLANG_TIDY_CHECKS} 19 20 DEPENDS 21 omp_gen 22 ClangDriverOptions 23 ) 24 25clang_target_link_libraries(clangTidyMain 26 PRIVATE 27 clangAST 28 clangASTMatchers 29 clangBasic 30 clangTooling 31 clangToolingCore 32 ) 33 34# Support plugins. 35if(CLANG_PLUGIN_SUPPORT) 36 set(support_plugins SUPPORT_PLUGINS) 37endif() 38 39add_clang_tool(clang-tidy 40 ClangTidyToolMain.cpp 41 42 DEPENDS 43 clang-resource-headers 44 ${support_plugins} 45 ) 46clang_target_link_libraries(clang-tidy 47 PRIVATE 48 clangAST 49 clangASTMatchers 50 clangBasic 51 clangTooling 52 clangToolingCore 53 ) 54target_link_libraries(clang-tidy 55 PRIVATE 56 clangTidy 57 clangTidyMain 58 ${ALL_CLANG_TIDY_CHECKS} 59 ) 60 61if(CLANG_PLUGIN_SUPPORT) 62 export_executable_symbols_for_plugins(clang-tidy) 63endif() 64 65install(PROGRAMS clang-tidy-diff.py 66 DESTINATION "${CMAKE_INSTALL_DATADIR}/clang" 67 COMPONENT clang-tidy) 68install(PROGRAMS run-clang-tidy.py 69 DESTINATION "${CMAKE_INSTALL_BINDIR}" 70 COMPONENT clang-tidy 71 RENAME run-clang-tidy) 72