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