summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/cmake/base-config-ix.cmake14
1 files changed, 12 insertions, 2 deletions
diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake
index b85720eadca..b4b87aa5307 100644
--- a/compiler-rt/cmake/base-config-ix.cmake
+++ b/compiler-rt/cmake/base-config-ix.cmake
@@ -47,11 +47,21 @@ if (LLVM_TREE_AVAILABLE)
${LLVM_INCLUDE_TESTS})
option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered"
${LLVM_ENABLE_WERROR})
+
# Use just-built Clang to compile/link tests on all platforms.
+ if (CMAKE_CROSSCOMPILING)
+ if (CMAKE_HOST_WIN32)
+ set(_host_executable_suffix ".exe")
+ else()
+ set(_host_executable_suffix "")
+ endif()
+ else()
+ set(_host_executable_suffix ${CMAKE_EXECUTABLE_SUFFIX})
+ endif()
set(COMPILER_RT_TEST_COMPILER
- ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX})
+ ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang${_host_executable_suffix})
set(COMPILER_RT_TEST_CXX_COMPILER
- ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX})
+ ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++${_host_executable_suffix})
else()
# Take output dir and install path from the user.
set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH
OpenPOWER on IntegriCloud