diff --git a/CMakeLists.txt b/CMakeLists.txt index fbf8e2bb90e..df781f52cdd 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 1e72258d448..94cc5551c8d 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)