summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rwxr-xr-xcmake/config-ix.cmake2
2 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fbf8e2bb90..df781f52cd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,6 +249,14 @@ option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
# BEFORE this include, otherwise options will not be correctly set on
# first cmake run
include(config-ix)
+
+# By default, we target the host, but this can be overridden at CMake
+# invocation time.
+set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_HOST_TRIPLE}" CACHE STRING
+ "Default target for which LLVM will generate code." )
+set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}" CACHE STRING
+ "Default target for which LLVM will generate code." )
+
include(HandleLLVMOptions)
# Verify that we can find a Python interpreter,
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 1e72258d44..94cc5551c8 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -294,9 +294,7 @@ 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(LLVM_HOSTTRIPLE "${LLVM_HOST_TRIPLE}")
-set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
# Determine the native architecture.
string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH)