2021-10-27 03:26:23 +08:00
|
|
|
llvm_canonicalize_cmake_booleans(
|
|
|
|
BOLT_ENABLE_RUNTIME
|
|
|
|
)
|
|
|
|
|
2018-06-23 04:50:07 +08:00
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
|
|
|
|
MAIN_CONFIG
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
|
|
|
|
)
|
2022-01-27 04:45:46 +08:00
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
|
|
|
|
MAIN_CONFIG
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
|
|
|
|
)
|
2018-06-23 04:50:07 +08:00
|
|
|
|
|
|
|
set(BOLT_TEST_PARAMS
|
|
|
|
bolt_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
)
|
|
|
|
|
2022-01-15 06:18:43 +08:00
|
|
|
if (BOLT_CLANG_EXE AND NOT "clang" IN_LIST LLVM_ENABLE_PROJECTS)
|
|
|
|
add_executable(clang IMPORTED GLOBAL)
|
|
|
|
set_property(TARGET clang PROPERTY IMPORTED_LOCATION "${BOLT_CLANG_EXE}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (BOLT_LLD_EXE AND NOT "lld" IN_LIST LLVM_ENABLE_PROJECTS)
|
|
|
|
add_executable(lld IMPORTED GLOBAL)
|
|
|
|
set_property(TARGET lld PROPERTY IMPORTED_LOCATION "${BOLT_LLD_EXE}")
|
|
|
|
endif()
|
|
|
|
|
2018-06-23 04:50:07 +08:00
|
|
|
list(APPEND BOLT_TEST_DEPS
|
2021-12-23 21:59:35 +08:00
|
|
|
clang
|
|
|
|
count
|
|
|
|
FileCheck
|
2021-06-30 00:54:08 +08:00
|
|
|
llc
|
2021-12-23 21:59:35 +08:00
|
|
|
lld
|
2018-06-23 04:50:07 +08:00
|
|
|
llvm-config
|
2019-10-15 07:03:54 +08:00
|
|
|
llvm-bolt
|
2021-11-16 05:53:18 +08:00
|
|
|
llvm-boltdiff
|
2022-02-03 09:54:19 +08:00
|
|
|
llvm-bolt-heatmap
|
2021-12-23 21:59:35 +08:00
|
|
|
llvm-dwarfdump
|
|
|
|
llvm-mc
|
2018-06-23 04:50:07 +08:00
|
|
|
llvm-nm
|
|
|
|
llvm-objdump
|
2021-10-30 04:31:22 +08:00
|
|
|
llvm-readelf
|
2018-06-23 04:50:07 +08:00
|
|
|
llvm-readobj
|
2021-05-05 07:45:28 +08:00
|
|
|
llvm-strip
|
2021-06-30 00:54:08 +08:00
|
|
|
llvm-objcopy
|
2021-12-23 21:59:35 +08:00
|
|
|
merge-fdata
|
|
|
|
not
|
|
|
|
perf2bolt
|
|
|
|
yaml2obj
|
2018-06-23 04:50:07 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(bolt-test-depends DEPENDS ${BOLT_TEST_DEPS})
|
2021-12-23 21:59:35 +08:00
|
|
|
set_target_properties(bolt-test-depends PROPERTIES FOLDER "BOLT")
|
2018-06-23 04:50:07 +08:00
|
|
|
|
|
|
|
add_lit_testsuite(check-bolt "Running the BOLT regression tests"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
PARAMS ${BOLT_TEST_PARAMS}
|
|
|
|
DEPENDS ${BOLT_TEST_DEPS}
|
|
|
|
ARGS ${BOLT_TEST_EXTRA_ARGS}
|
|
|
|
)
|
2021-12-23 21:59:35 +08:00
|
|
|
set_target_properties(check-bolt PROPERTIES FOLDER "BOLT")
|
2018-06-23 04:50:07 +08:00
|
|
|
|
|
|
|
add_lit_testsuites(BOLT ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
PARAMS ${BOLT_TEST_PARAMS}
|
|
|
|
DEPENDS ${BOLT_TEST_DEPS}
|
|
|
|
)
|