| 1 |
set(LLVM_LINK_COMPONENTS |
| 2 |
MC |
| 3 |
MCA |
| 4 |
Object |
| 5 |
Support |
| 6 |
TargetParser |
| 7 |
) |
| 8 |
|
| 9 |
set(mca_root ${LLVM_MAIN_SRC_DIR}/tools/llvm-mca) |
| 10 |
|
| 11 |
set(mca_includes |
| 12 |
${CMAKE_CURRENT_SOURCE_DIR} |
| 13 |
${mca_root} |
| 14 |
) |
| 15 |
|
| 16 |
# Right now we only need SummaryView. |
| 17 |
set(mca_views_sources |
| 18 |
SummaryView.cpp |
| 19 |
) |
| 20 |
list(TRANSFORM mca_views_sources PREPEND "${mca_root}/Views/") |
| 21 |
|
| 22 |
set(mca_sources |
| 23 |
MCATestBase.cpp |
| 24 |
${mca_views_sources} |
| 25 |
) |
| 26 |
|
| 27 |
function(add_llvm_mca_unittest_includes) |
| 28 |
set(mca_includes ${mca_includes} ${ARGV} PARENT_SCOPE) |
| 29 |
endfunction() |
| 30 |
|
| 31 |
function(add_llvm_mca_unittest_sources) |
| 32 |
set(sources ${ARGV}) |
| 33 |
list(TRANSFORM sources PREPEND "${CMAKE_CURRENT_LIST_DIR}/") |
| 34 |
set(mca_sources ${mca_sources} ${sources} PARENT_SCOPE) |
| 35 |
endfunction() |
| 36 |
|
| 37 |
function(add_llvm_mca_unittest_link_components comps) |
| 38 |
set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} ${ARGV} PARENT_SCOPE) |
| 39 |
endfunction() |
| 40 |
|
| 41 |
if(LLVM_TARGETS_TO_BUILD MATCHES "X86") |
| 42 |
include(X86/CMakeLists.txt) |
| 43 |
endif() |
| 44 |
|
| 45 |
list(REMOVE_DUPLICATES LLVM_LINK_COMPONENTS) |
| 46 |
|
| 47 |
include_directories(${mca_includes}) |
| 48 |
|
| 49 |
add_llvm_target_unittest(LLVMMCATests |
| 50 |
${mca_sources} |
| 51 |
) |
| 52 |
|
| 53 |
set_property(TARGET LLVMMCATests PROPERTY FOLDER "Tests/UnitTests/ToolTests") |