OSDN Git Service

[clang-tidy] Fix linking tests to LLVMTestingSupport
authorMichał Górny <mgorny@moritz.systems>
Fri, 29 Jan 2021 01:14:47 +0000 (02:14 +0100)
committerTom Stellard <tstellar@redhat.com>
Sat, 30 Jan 2021 06:06:51 +0000 (22:06 -0800)
LLVMTestingSupport is not part of libLLVM, and therefore can not
be linked to via LLVM_LINK_COMPONENTS.  Instead, it needs to be
specified explicitly to ensure that it is linked explicitly
even if LLVM_LINK_LLVM_DYLIB is used.  This is consistent with handling
in clangd.

Fixes PR#48931

Differential Revision: https://reviews.llvm.org/D95653

(cherry picked from commit 632545e8ce846ccaeca8df15a3dc5e36d01a1275)

clang-tools-extra/unittests/clang-tidy/CMakeLists.txt

index be35b71..05d330d 100644 (file)
@@ -1,7 +1,6 @@
 set(LLVM_LINK_COMPONENTS
   FrontendOpenMP
   Support
-  TestingSupport
   )
 
 get_filename_component(CLANG_LINT_SOURCE_DIR
@@ -46,4 +45,5 @@ target_link_libraries(ClangTidyTests
   clangTidyObjCModule
   clangTidyReadabilityModule
   clangTidyUtils
+  LLVMTestingSupport
   )