From 0e63ab4243089639c1b3f51f5ddd9c9761949644 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Thu, 25 Aug 2016 12:03:33 +0000 Subject: [PATCH] Use configure_lit_site_cfg instead of configure_file. configure_lit_site_cfg defines some more parameters that are used in lit.site.cfg.in. configure_file would leave those empty. These additional definitions seem to be unimportant for regression tests, but unittests do not work without them. In case of out-of-tree builds, define the additional parameters with default values. These may not take all configuration parameters into account, as configure_lit_site_cfg would. llvm-svn: 279733 --- polly/test/CMakeLists.txt | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/polly/test/CMakeLists.txt b/polly/test/CMakeLists.txt index e34811c..5dadef2 100644 --- a/polly/test/CMakeLists.txt +++ b/polly/test/CMakeLists.txt @@ -37,6 +37,21 @@ if (NOT DEFINED LLVM_MAIN_SRC_DIR) set(POLLY_TEST_EXTRA_ARGS ${POLLY_TEST_EXTRA_ARGS} "--vg") endif () + # Parameters required for lit.site.cfg.in + set(LLVM_SOURCE_DIR ${LLVM_SOURCE_ROOT}) + if (CMAKE_CFG_INTDIR STREQUAL ".") + set(LLVM_BUILD_MODE ".") + else () + set(LLVM_BUILD_MODE "%(build_mode)s") + endif () + set(ENABLE_SHARED "1") + set(SHLIBDIR "${LLVM_BINARY_DIR}/bin") + set(LINK_POLLY_INTO_TOOLS "OFF") + + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) + foreach(testdir ${POLLY_TEST_DIRECTORIES}) add_custom_target(polly-test-${testdir} COMMAND ${LLVM_LIT} @@ -70,6 +85,10 @@ else (NOT DEFINED LLVM_MAIN_SRC_DIR) set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}") set(POLLY_LIB_DIR "${LLVM_LIBS_DIR}") + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) + add_lit_testsuite(check-polly "Running polly regression tests" ${CMAKE_CURRENT_BINARY_DIR} PARAMS polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg @@ -92,10 +111,6 @@ else (NOT DEFINED LLVM_MAIN_SRC_DIR) endif (NOT DEFINED LLVM_MAIN_SRC_DIR) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) - -configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/update_check.py ${CMAKE_CURRENT_BINARY_DIR}/update_check.py) file(COPY ${CMAKE_CURRENT_BINARY_DIR}/update_check.py -- 2.7.4