[LLVMTestingSupport] Add explicit linkage to LLVMSupport
authorMichal Gorny <mgorny@gentoo.org>
Sun, 8 Apr 2018 06:49:17 +0000 (06:49 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Sun, 8 Apr 2018 06:49:17 +0000 (06:49 +0000)
Explicitly link LLVMTestingSupport library against LLVMSupport. This
is necessary to fix linking errors when LLVMTestingSupport is built
as a shared library (with BUILD_SHARED_LIBS=ON) and -Wl,-z,defs is used.

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

llvm-svn: 329522

llvm/lib/Testing/Support/CMakeLists.txt

index 8ab6fd9..969875e 100644 (file)
@@ -8,8 +8,11 @@ add_llvm_library(LLVMTestingSupport
   
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Testing/Support
+
+  LINK_COMPONENTS
+  Support
   )
 
 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include)
-target_link_libraries(LLVMTestingSupport PRIVATE gtest)
\ No newline at end of file
+target_link_libraries(LLVMTestingSupport PRIVATE gtest)