aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-c-test/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-c-test/CMakeLists.txt')
-rw-r--r--tools/llvm-c-test/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/llvm-c-test/CMakeLists.txt b/tools/llvm-c-test/CMakeLists.txt
index 34fea3d..989678b 100644
--- a/tools/llvm-c-test/CMakeLists.txt
+++ b/tools/llvm-c-test/CMakeLists.txt
@@ -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()