From e1bd40cfbd618e1ebeba288e844d424df10c601d Mon Sep 17 00:00:00 2001 From: Hongbin Zheng Date: Fri, 29 Apr 2011 07:34:54 +0000 Subject: [PATCH] Partial support test polly for out of tree build. llvm-svn: 130482 --- polly/test/CMakeLists.txt | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/polly/test/CMakeLists.txt b/polly/test/CMakeLists.txt index a3b32de0ca3c..2e8a27627806 100644 --- a/polly/test/CMakeLists.txt +++ b/polly/test/CMakeLists.txt @@ -5,13 +5,28 @@ set(POLLY_TEST_DIRECTORIES "OpenMP" "polybench") -set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}") -set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}") -set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/") -set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib") + set(POLLY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") set(POLLY_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..") +if (NOT DEFINED LLVM_MAIN_SRC_DIR) + # We are building polly out of tree, adjust the settings. + # FIXME: FileCheck is not available in llvm install directory at the moment. + set(LLVM_LIT ${LLVM_INSTALL_ROOT}/bin/llvm-lit) + set(POLLY_TEST_DEPS LLVMPolly) + + set(LLVM_BINARY_DIR "${LLVM_INSTALL_ROOT}") + set(LLVM_TOOLS_DIR "${LLVM_INSTALL_ROOT}/bin") + set(LLVM_LIBS_DIR "${LLVM_INSTALL_ROOT}/lib") +else (NOT DEFINED LLVM_MAIN_SRC_DIR) + set(LLVM_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit) + set(POLLY_TEST_DEPS opt lli LLVMPolly) + + set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}") + set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/") + set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib") +endif (NOT DEFINED LLVM_MAIN_SRC_DIR) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) @@ -30,23 +45,21 @@ if(PYTHONINTERP_FOUND) foreach(testdir ${POLLY_TEST_DIRECTORIES}) add_custom_target(polly-test-${testdir} - COMMAND ${PYTHON_EXECUTABLE} - ${LLVM_SOURCE_DIR}/utils/lit/lit.py + COMMAND ${LLVM_LIT} --param polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg --param build_config=${CMAKE_CFG_INTDIR} -sv ${POLLY_TEST_EXTRA_ARGS} ${CMAKE_CURRENT_BINARY_DIR}/${testdir} - DEPENDS opt LLVMPolly + DEPENDS ${POLLY_TEST_DEPS} COMMENT "Running Polly regression tests in ${testdir}") endforeach() add_custom_target(polly-test - COMMAND ${PYTHON_EXECUTABLE} - ${LLVM_SOURCE_DIR}/utils/lit/lit.py + COMMAND ${LLVM_LIT} --param polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg --param build_config=${CMAKE_CFG_INTDIR} -sv ${POLLY_TEST_EXTRA_ARGS} ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS opt LLVMPolly + DEPENDS ${POLLY_TEST_DEPS} COMMENT "Running Polly regression tests") endif()