summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/config-ix.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/cmake/config-ix.cmake')
-rwxr-xr-xllvm/cmake/config-ix.cmake9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index b380a48637f..f6eeea9ee60 100755
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -287,15 +287,18 @@ include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)
-include(GetTargetTriple)
-get_target_triple(LLVM_DEFAULT_TARGET_TRIPLE)
+include(GetHostTriple)
+get_host_triple(LLVM_HOST_TRIPLE)
+# By default, we target the host, but this can be overridden at CMake
+# invocation time.
+set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_HOST_TRIPLE}")
set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
# Determine the native architecture.
string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH)
if( LLVM_NATIVE_ARCH STREQUAL "host" )
- string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_DEFAULT_TARGET_TRIPLE})
+ string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_HOST_TRIPLE})
endif ()
if (LLVM_NATIVE_ARCH MATCHES "i[2-6]86")
OpenPOWER on IntegriCloud