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