NAKAMURA Takumi | b5c4b876 | 2013-12-10 11:13:32 +0000 | [diff] [blame] | 1 | set(LLVM_LINK_COMPONENTS |
| 2 | ${LLVM_TARGETS_TO_BUILD} |
| 3 | BitReader |
| 4 | Core |
| 5 | MCDisassembler |
| 6 | Object |
Amaury Sechet | f01be74 | 2016-02-05 00:19:50 +0000 | [diff] [blame] | 7 | Support |
NAKAMURA Takumi | b5c4b876 | 2013-12-10 11:13:32 +0000 | [diff] [blame] | 8 | Target |
| 9 | ) |
Anders Waldenborg | b932c66 | 2013-10-23 08:10:20 +0000 | [diff] [blame] | 10 | |
Chris Bieneman | 9ef9c11 | 2014-12-18 21:03:49 +0000 | [diff] [blame] | 11 | # We should only have llvm-c-test use libLLVM if libLLVM is built with the |
| 12 | # default list of components. Using libLLVM with custom components can result in |
| 13 | # build failures. |
| 14 | |
| 15 | set (USE_LLVM_DYLIB FALSE) |
| 16 | |
| 17 | if (TARGET LLVM) |
| 18 | set (USE_LLVM_DYLIB TRUE) |
| 19 | if (DEFINED LLVM_DYLIB_COMPONENTS) |
| 20 | foreach(c in ${LLVM_LINK_COMPONENTS}) |
| 21 | list(FIND LLVM_DYLIB_COMPONENTS ${c} C_IDX) |
| 22 | if (C_IDX EQUAL -1) |
| 23 | set(USE_LLVM_DYLIB FALSE) |
| 24 | break() |
| 25 | endif() |
| 26 | endforeach() |
| 27 | endif() |
| 28 | endif() |
| 29 | |
| 30 | if(USE_LLVM_DYLIB) |
NAKAMURA Takumi | f96d423 | 2014-11-10 15:04:26 +0000 | [diff] [blame] | 31 | set(LLVM_LINK_COMPONENTS) |
| 32 | endif() |
| 33 | |
Anders Waldenborg | b932c66 | 2013-10-23 08:10:20 +0000 | [diff] [blame] | 34 | if (LLVM_COMPILER_IS_GCC_COMPATIBLE) |
Rafael Espindola | 4daaa8e | 2014-01-08 11:48:19 +0000 | [diff] [blame] | 35 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wstrict-prototypes") |
Anders Waldenborg | b932c66 | 2013-10-23 08:10:20 +0000 | [diff] [blame] | 36 | endif () |
| 37 | |
| 38 | add_llvm_tool(llvm-c-test |
Amaury Sechet | 003216b | 2016-11-15 22:19:59 +0000 | [diff] [blame] | 39 | attributes.c |
Anders Waldenborg | b932c66 | 2013-10-23 08:10:20 +0000 | [diff] [blame] | 40 | calc.c |
Jeroen Ketema | ad659c3 | 2016-04-08 09:19:02 +0000 | [diff] [blame] | 41 | diagnostic.c |
Anders Waldenborg | b932c66 | 2013-10-23 08:10:20 +0000 | [diff] [blame] | 42 | disassemble.c |
Amaury Sechet | e8ea7d8 | 2016-02-04 23:26:19 +0000 | [diff] [blame] | 43 | echo.cpp |
Anders Waldenborg | b932c66 | 2013-10-23 08:10:20 +0000 | [diff] [blame] | 44 | helpers.c |
| 45 | include-all.c |
| 46 | main.c |
| 47 | module.c |
Bjorn Steinbrink | a09ac00 | 2015-01-28 16:35:59 +0000 | [diff] [blame] | 48 | metadata.c |
Anders Waldenborg | b932c66 | 2013-10-23 08:10:20 +0000 | [diff] [blame] | 49 | object.c |
| 50 | targets.c |
| 51 | ) |
NAKAMURA Takumi | f96d423 | 2014-11-10 15:04:26 +0000 | [diff] [blame] | 52 | |
Chris Bieneman | 9ef9c11 | 2014-12-18 21:03:49 +0000 | [diff] [blame] | 53 | if(USE_LLVM_DYLIB) |
NAKAMURA Takumi | f96d423 | 2014-11-10 15:04:26 +0000 | [diff] [blame] | 54 | target_link_libraries(llvm-c-test LLVM) |
| 55 | endif() |