74 lines · plain
1set(LLVM_LINK_COMPONENTS2 FrontendOpenMP3 Support4 )5 6if(CLANG_BUILT_STANDALONE)7 # LLVMTestingSupport library is needed for clang-tidy tests.8 if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support9 AND NOT TARGET LLVMTestingSupport)10 add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support11 lib/Testing/Support)12 endif()13endif()14 15get_filename_component(CLANG_LINT_SOURCE_DIR16 ${CMAKE_CURRENT_SOURCE_DIR}/../../clang-tidy REALPATH)17include_directories(${CLANG_LINT_SOURCE_DIR})18include_directories(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}/../../include-cleaner/include")19 20add_extra_unittest(ClangTidyTests21 AddConstTest.cpp22 ClangTidyDiagnosticConsumerTest.cpp23 ClangTidyOptionsTest.cpp24 DeclRefExprUtilsTest.cpp25 IncludeCleanerTest.cpp26 IncludeInserterTest.cpp27 GlobListTest.cpp28 GoogleModuleTest.cpp29 LLVMModuleTest.cpp30 ModernizeModuleTest.cpp31 NamespaceAliaserTest.cpp32 ObjCModuleTest.cpp33 OptionsProviderTest.cpp34 OverlappingReplacementsTest.cpp35 UsingInserterTest.cpp36 ReadabilityModuleTest.cpp37 TransformerClangTidyCheckTest.cpp38 )39 40clang_target_link_libraries(ClangTidyTests41 PRIVATE42 clangAST43 clangASTMatchers44 clangBasic45 clangFrontend46 clangLex47 clangSerialization48 clangTooling49 clangToolingCore50 clangTransformer51 clangIncludeCleaner52 )53target_link_libraries(ClangTidyTests54 PRIVATE55 clangTidy56 clangTidyAndroidModule57 clangTidyGoogleModule58 clangTidyMiscModule59 clangTidyLLVMModule60 clangTidyModernizeModule61 clangTidyObjCModule62 clangTidyReadabilityModule63 clangTidyUtils64 LLVMTestingAnnotations65 LLVMTestingSupport66 )67 68if(CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS)69 target_link_libraries(ClangTidyTests70 PRIVATE71 clangTidyCustomModule72 )73endif()74