[clangd] Fix warnings
[llvm-project.git] / llvm / unittests / tools / llvm-exegesis / CMakeLists.txt
blob3ee3a0dc6b5d04d0fe2c47ab62512dbe072e93b5
1 set(exegesis_includes
2   ${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
3   )
5 set(LLVM_LINK_COMPONENTS
6   CodeGenTypes
7   MC
8   MCParser
9   Object
10   Support
11   Symbolize
12   TargetParser
13   )
15 set(exegesis_sources
16   BenchmarkRunnerTest.cpp
17   ClusteringTest.cpp
18   ProgressMeterTest.cpp
19   RegisterValueTest.cpp
20   ResultAggregatorTest.cpp
21   )
23 set(exegesis_link_libraries LLVMExegesis)
25 function(add_llvm_exegesis_unittest_includes)
26   set(exegesis_includes ${exegesis_includes} ${ARGV} PARENT_SCOPE)
27 endfunction()
29 function(add_llvm_exegesis_unittest_sources)
30   set(sources ${ARGV})
31   list(TRANSFORM sources PREPEND "${CMAKE_CURRENT_LIST_DIR}/")
32   set(exegesis_sources ${exegesis_sources} ${sources} PARENT_SCOPE)
33 endfunction()
35 function(add_llvm_exegesis_unittest_link_components comps)
36   set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} ${ARGV} PARENT_SCOPE)
37 endfunction()
39 function(add_llvm_exegesis_unittest_link_libraries libs)
40   set(exegesis_link_libraries ${exegesis_link_libraries} ${ARGV} PARENT_SCOPE)
41 endfunction()
44 if(LLVM_TARGETS_TO_BUILD MATCHES "X86")
45   include(X86/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})