diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2011-02-05 19:08:56 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2011-02-05 19:08:56 +0000 |
commit | 57ca32bbf03d30b8867f6c07f1a3e42484bbfec7 (patch) | |
tree | 4bb3f0d1fb0136304261cbe62b36bf0f7008eda5 | |
parent | bbfd5babab059af14eed20b63b2aabedaa6a6ac7 (diff) |
Support `make clang-test' when Clang is compiled outside of LLVM.
This may not work on build platforms that place the binaries on
special folders ($build_dir/bin/Release/) such as the VS IDE and
XCode. For fixing this it is necessary to add a lit.py configuration
option for saying where the Clang binaries are, and apply to that path
the same magit that is used with the path to the LLVM tools binary
directory. Doing this requires a bit of autoconf work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124969 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CMakeLists.txt | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b32c82e8e2..c4237eb051 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -47,7 +47,13 @@ configure_file( include(FindPythonInterp) if(PYTHONINTERP_FOUND) - set(CLANG_TEST_EXTRA_ARGS) + if( LLVM_MAIN_SRC_DIR ) + set(LIT "${LLVM_SOURCE_DIR}/utils/lit/lit.py") + else() + set(LIT "${PATH_TO_LLVM_BUILD}/bin/llvm-lit") + endif() + + set(CLANG_TEST_EXTRA_ARGS "--path=${CLANG_BINARY_DIR}/bin") option(CLANG_TEST_USE_VG "Run Clang tests under Valgrind" OFF) if(CLANG_TEST_USE_VG) @@ -60,7 +66,7 @@ if(PYTHONINTERP_FOUND) foreach(testdir ${CLANG_TEST_DIRECTORIES}) add_custom_target(clang-test-${testdir} COMMAND ${PYTHON_EXECUTABLE} - ${LLVM_SOURCE_DIR}/utils/lit/lit.py + ${LIT} --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg --param build_config=${CMAKE_CFG_INTDIR} ${LIT_ARGS} @@ -71,7 +77,7 @@ if(PYTHONINTERP_FOUND) add_custom_target(clang-test COMMAND ${PYTHON_EXECUTABLE} - ${LLVM_SOURCE_DIR}/utils/lit/lit.py + ${LIT} --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg --param build_config=${CMAKE_CFG_INTDIR} ${LIT_ARGS} @@ -80,7 +86,7 @@ if(PYTHONINTERP_FOUND) add_custom_target(clang-c++tests COMMAND ${PYTHON_EXECUTABLE} - ${LLVM_SOURCE_DIR}/utils/lit/lit.py + ${LIT} --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg --param build_config=${CMAKE_CFG_INTDIR} ${LIT_ARGS} @@ -90,7 +96,7 @@ if(PYTHONINTERP_FOUND) add_custom_target(check-all COMMAND ${PYTHON_EXECUTABLE} - ${LLVM_SOURCE_DIR}/utils/lit/lit.py + ${LIT} --param build_config=${CMAKE_CFG_INTDIR} --param build_mode=${RUNTIME_BUILD_MODE} ${LIT_ARGS} |