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