[CMake] llvm-c-test: Use libLLVM.so if it is available.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 10 Nov 2014 15:04:26 +0000 (15:04 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 10 Nov 2014 15:04:26 +0000 (15:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221592 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-c-test/CMakeLists.txt

index 34fea3d..989678b 100644 (file)
@@ -7,6 +7,10 @@ set(LLVM_LINK_COMPONENTS
   Target
   )
 
+if(TARGET LLVM)
+  set(LLVM_LINK_COMPONENTS)
+endif()
+
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wstrict-prototypes")
 endif ()
@@ -21,3 +25,8 @@ add_llvm_tool(llvm-c-test
   object.c
   targets.c
   )
+
+# Use libLLVM.so if it is available.
+if(TARGET LLVM)
+  target_link_libraries(llvm-c-test LLVM)
+endif()