aboutsummaryrefslogtreecommitdiffstats
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-08-30 14:49:00 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-08-30 14:49:00 +0000
commit06b7f585229f9a4828ae2ae3b3764094b92cee5d (patch)
tree571170115452c734562d726ff571fb781831bd7e /test/CMakeLists.txt
parent033927408e7a37815402d8748dd424be437c00d0 (diff)
downloadexternal_llvm-06b7f585229f9a4828ae2ae3b3764094b92cee5d.zip
external_llvm-06b7f585229f9a4828ae2ae3b3764094b92cee5d.tar.gz
external_llvm-06b7f585229f9a4828ae2ae3b3764094b92cee5d.tar.bz2
Test: Fix LLVMC tests on CMake.
The CMake build didn't define TEST_COMPILE_CXX_CMD. The tests assumed gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 433af90..ad9a243 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -24,6 +24,23 @@ endif()
include(FindPythonInterp)
if(PYTHONINTERP_FOUND)
+ get_directory_property(DEFINITIONS COMPILE_DEFINITIONS)
+ foreach(DEF ${DEFINITIONS})
+ set(DEFS "${DEFS} -D${DEF}")
+ endforeach()
+ get_directory_property(INC_DIRS INCLUDE_DIRECTORIES)
+ foreach(INC_DIR ${INC_DIRS})
+ set(IDIRS "${IDIRS} -I${INC_DIR}")
+ endforeach()
+ string(REPLACE "<CMAKE_CXX_COMPILER>" "${CMAKE_CXX_COMPILER}" TEST_COMPILE_CXX_CMD ${CMAKE_CXX_COMPILE_OBJECT})
+ string(REPLACE "<DEFINES>" "${DEFS}" TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
+ string(REPLACE "<FLAGS>" "${CMAKE_CXX_FLAGS}" TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
+ string(REPLACE "-o" "" TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
+ string(REGEX REPLACE "<[^>]+>" "" TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
+ set(TEST_COMPILE_CXX_CMD "${TEST_COMPILE_CXX_CMD} ${IDIRS}")
+ if(NOT MSVC)
+ set(TEST_COMPILE_CXX_CMD "${TEST_COMPILE_CXX_CMD} -x c++")
+ endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/site.exp.in
${CMAKE_CURRENT_BINARY_DIR}/site.exp)