2011-12-18 16:27:59 +08:00
|
|
|
set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}")
|
|
|
|
set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
|
|
|
|
set(LLVM_BUILD_MODE "%(build_mode)s")
|
|
|
|
set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
|
2014-12-29 20:11:30 +08:00
|
|
|
set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s")
|
2011-12-18 16:27:59 +08:00
|
|
|
set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
|
|
|
set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
set(ENABLE_SHARED 1)
|
|
|
|
else()
|
|
|
|
set(ENABLE_SHARED 0)
|
|
|
|
endif(BUILD_SHARED_LIBS)
|
|
|
|
|
2013-01-13 09:09:51 +08:00
|
|
|
configure_lit_site_cfg(
|
2011-12-18 16:27:59 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
|
2013-07-24 07:42:17 +08:00
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
|
|
|
|
)
|
2011-12-18 16:27:59 +08:00
|
|
|
|
2015-01-13 05:41:10 +08:00
|
|
|
set(LLD_TEST_DEPS
|
2016-10-21 04:50:00 +08:00
|
|
|
FileCheck not llvm-ar llvm-as llvm-dis llvm-dwarfdump llvm-nm
|
|
|
|
llc lld llvm-config llvm-objdump llvm-readobj yaml2obj obj2yaml
|
2016-10-13 08:49:21 +08:00
|
|
|
llvm-mc llvm-lib llvm-pdbdump opt
|
2015-01-13 05:41:10 +08:00
|
|
|
)
|
2015-03-13 00:49:52 +08:00
|
|
|
if (LLVM_INCLUDE_TESTS)
|
|
|
|
set(LLD_TEST_DEPS ${LLD_TEST_DEPS} LLDUnitTests)
|
|
|
|
endif()
|
|
|
|
|
2015-01-13 05:41:10 +08:00
|
|
|
set(LLD_TEST_PARAMS
|
|
|
|
lld_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
)
|
2012-08-01 02:44:52 +08:00
|
|
|
|
2015-01-13 05:41:10 +08:00
|
|
|
add_lit_testsuite(check-lld "Running lld test suite"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
PARAMS lld_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
lld_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
|
|
|
|
DEPENDS ${LLD_TEST_DEPS}
|
|
|
|
)
|
2011-12-18 16:27:59 +08:00
|
|
|
|
2015-01-13 05:41:10 +08:00
|
|
|
set_target_properties(check-lld PROPERTIES FOLDER "lld tests")
|
2012-08-01 02:44:52 +08:00
|
|
|
|
|
|
|
# Add a legacy target spelling: lld-test
|
|
|
|
add_custom_target(lld-test)
|
|
|
|
add_dependencies(lld-test check-lld)
|
|
|
|
set_target_properties(lld-test PROPERTIES FOLDER "lld tests")
|