diff -Naur clang-tools-extra-12.0.0rc1.src.orig/unittests/clang-tidy/CMakeLists.txt clang-tools-extra-12.0.0rc1.src/unittests/clang-tidy/CMakeLists.txt --- clang-tools-extra-12.0.0rc1.src.orig/unittests/clang-tidy/CMakeLists.txt 2021-02-15 11:12:22.000000000 +0100 +++ clang-tools-extra-12.0.0rc1.src/unittests/clang-tidy/CMakeLists.txt 2021-02-15 17:02:32.000000000 +0100 @@ -1,9 +1,17 @@ set(LLVM_LINK_COMPONENTS FrontendOpenMP Support - TestingSupport ) +if(CLANG_BUILT_STANDALONE) + # LLVMTestingSupport library is needed for clang-tidy tests. + if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support + AND NOT TARGET LLVMTestingSupport) + add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support + lib/Testing/Support) + endif() +endif() + get_filename_component(CLANG_LINT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../clang-tidy REALPATH) include_directories(${CLANG_LINT_SOURCE_DIR}) @@ -37,6 +45,7 @@ clangToolingCore clangTransformer ) + target_link_libraries(ClangTidyTests PRIVATE clangTidy @@ -46,4 +55,5 @@ clangTidyObjCModule clangTidyReadabilityModule clangTidyUtils + LLVMTestingSupport )