[CMake] llvm-c-test: Use libLLVM.so if it is available.
[oota-llvm.git] / tools / llvm-c-test / CMakeLists.txt
1 set(LLVM_LINK_COMPONENTS
2   ${LLVM_TARGETS_TO_BUILD}
3   BitReader
4   Core
5   MCDisassembler
6   Object
7   Target
8   )
9
10 if(TARGET LLVM)
11   set(LLVM_LINK_COMPONENTS)
12 endif()
13
14 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
15   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wstrict-prototypes")
16 endif ()
17
18 add_llvm_tool(llvm-c-test
19   calc.c
20   disassemble.c
21   helpers.c
22   include-all.c
23   main.c
24   module.c
25   object.c
26   targets.c
27   )
28
29 # Use libLLVM.so if it is available.
30 if(TARGET LLVM)
31   target_link_libraries(llvm-c-test LLVM)
32 endif()