61 lines · plain
1set(LLVM_LINK_COMPONENTS2 AllTargetsAsmParsers3 AllTargetsCodeGens4 AllTargetsDescs5 AllTargetsDisassemblers6 AllTargetsInfos7 BitReader8 Core9 MCDisassembler10 Object11 Support12 Target13 )14 15# We should only have llvm-c-test use libLLVM if libLLVM is built with the16# default list of components. Using libLLVM with custom components can result in17# build failures.18 19set (USE_LLVM_DYLIB FALSE)20 21if (TARGET LLVM)22 set (USE_LLVM_DYLIB TRUE)23 if (DEFINED LLVM_DYLIB_COMPONENTS)24 foreach(c in ${LLVM_LINK_COMPONENTS})25 list(FIND LLVM_DYLIB_COMPONENTS ${c} C_IDX)26 if (C_IDX EQUAL -1)27 set(USE_LLVM_DYLIB FALSE)28 break()29 endif()30 endforeach()31 endif()32endif()33 34if(USE_LLVM_DYLIB)35 set(LLVM_LINK_COMPONENTS)36endif()37 38if (LLVM_COMPILER_IS_GCC_COMPATIBLE)39 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wstrict-prototypes")40endif ()41 42add_llvm_tool(llvm-c-test43 attributes.c44 calc.c45 debuginfo.c46 diagnostic.c47 disassemble.c48 echo.cpp49 helpers.c50 include-all.c51 main.c52 module.c53 metadata.c54 object.c55 targets.c56 )57 58if(USE_LLVM_DYLIB)59 target_link_libraries(llvm-c-test LLVM)60endif()61