| 1 |
set(exegesis_includes |
| 2 |
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib |
| 3 |
) |
| 4 |
|
| 5 |
set(LLVM_LINK_COMPONENTS |
| 6 |
MC |
| 7 |
MCParser |
| 8 |
Object |
| 9 |
Support |
| 10 |
Symbolize |
| 11 |
TargetParser |
| 12 |
) |
| 13 |
|
| 14 |
set(exegesis_sources |
| 15 |
BenchmarkRunnerTest.cpp |
| 16 |
ClusteringTest.cpp |
| 17 |
ProgressMeterTest.cpp |
| 18 |
RegisterValueTest.cpp |
| 19 |
) |
| 20 |
|
| 21 |
set(exegesis_link_libraries LLVMExegesis) |
| 22 |
|
| 23 |
function(add_llvm_exegesis_unittest_includes) |
| 24 |
set(exegesis_includes ${exegesis_includes} ${ARGV} PARENT_SCOPE) |
| 25 |
endfunction() |
| 26 |
|
| 27 |
function(add_llvm_exegesis_unittest_sources) |
| 28 |
set(sources ${ARGV}) |
| 29 |
list(TRANSFORM sources PREPEND "${CMAKE_CURRENT_LIST_DIR}/") |
| 30 |
set(exegesis_sources ${exegesis_sources} ${sources} PARENT_SCOPE) |
| 31 |
endfunction() |
| 32 |
|
| 33 |
function(add_llvm_exegesis_unittest_link_components comps) |
| 34 |
set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} ${ARGV} PARENT_SCOPE) |
| 35 |
endfunction() |
| 36 |
|
| 37 |
function(add_llvm_exegesis_unittest_link_libraries libs) |
| 38 |
set(exegesis_link_libraries ${exegesis_link_libraries} ${ARGV} PARENT_SCOPE) |
| 39 |
endfunction() |
| 40 |
|
| 41 |
|
| 42 |
if(LLVM_TARGETS_TO_BUILD MATCHES "X86") |
| 43 |
include(X86/CMakeLists.txt) |
| 44 |
endif() |
| 45 |
if(LLVM_TARGETS_TO_BUILD MATCHES "ARM") |
| 46 |
include(ARM/CMakeLists.txt) |
| 47 |
endif() |
| 48 |
if(LLVM_TARGETS_TO_BUILD MATCHES "AArch64") |
| 49 |
include(AArch64/CMakeLists.txt) |
| 50 |
endif() |
| 51 |
if(LLVM_TARGETS_TO_BUILD MATCHES "PowerPC") |
| 52 |
include(PowerPC/CMakeLists.txt) |
| 53 |
endif() |
| 54 |
if(LLVM_TARGETS_TO_BUILD MATCHES "Mips") |
| 55 |
include(Mips/CMakeLists.txt) |
| 56 |
endif() |
| 57 |
|
| 58 |
include_directories(${exegesis_includes}) |
| 59 |
|
| 60 |
list(REMOVE_DUPLICATES LLVM_LINK_COMPONENTS) |
| 61 |
|
| 62 |
add_llvm_target_unittest(LLVMExegesisTests |
| 63 |
${exegesis_sources} |
| 64 |
) |
| 65 |
target_link_libraries(LLVMExegesisTests PRIVATE ${exegesis_link_libraries}) |
| 66 |
|
| 67 |
set_property(TARGET LLVMExegesisTests PROPERTY FOLDER "Tests/UnitTests/ToolTests") |