summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-01-24 18:00:44 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-01-24 18:00:44 +0000
commitbeb3e7e0761aeda36fd295b73c530f189b5a13d9 (patch)
tree6631947bd030add5b061d75cb1123e50e6c9bca1
parent3cfef8d46737ca8b4a17a20a45868c104c2afce0 (diff)
downloadbcm5719-llvm-beb3e7e0761aeda36fd295b73c530f189b5a13d9.tar.gz
bcm5719-llvm-beb3e7e0761aeda36fd295b73c530f189b5a13d9.zip
Undo an over zealous rename. This bit of the CMake build really is
dealing in the host triple, be honest about it and document the decision to default the target triple to the host triple unless overridden. llvm-svn: 148822
-rwxr-xr-xllvm/cmake/config-ix.cmake9
-rw-r--r--llvm/cmake/modules/CMakeLists.txt2
-rw-r--r--llvm/cmake/modules/GetHostTriple.cmake (renamed from llvm/cmake/modules/GetTargetTriple.cmake)4
3 files changed, 9 insertions, 6 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")
diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt
index 88d985208c7..f51e9af8db0 100644
--- a/llvm/cmake/modules/CMakeLists.txt
+++ b/llvm/cmake/modules/CMakeLists.txt
@@ -32,6 +32,6 @@ install(DIRECTORY .
PATTERN LLVMConfig.cmake EXCLUDE
PATTERN LLVMConfigVersion.cmake EXCLUDE
PATTERN LLVM-Config.cmake EXCLUDE
- PATTERN GetTargetTriple.cmake EXCLUDE
+ PATTERN GetHostTriple.cmake EXCLUDE
PATTERN VersionFromVCS.cmake EXCLUDE
PATTERN CheckAtomic.cmake EXCLUDE)
diff --git a/llvm/cmake/modules/GetTargetTriple.cmake b/llvm/cmake/modules/GetHostTriple.cmake
index f4321c9b67e..671a8ce7d7c 100644
--- a/llvm/cmake/modules/GetTargetTriple.cmake
+++ b/llvm/cmake/modules/GetHostTriple.cmake
@@ -1,7 +1,7 @@
# Returns the host triple.
# Invokes config.guess
-function( get_target_triple var )
+function( get_host_triple var )
if( MSVC )
if( CMAKE_CL_64 )
set( value "x86_64-pc-win32" )
@@ -27,4 +27,4 @@ function( get_target_triple var )
endif( MSVC )
set( ${var} ${value} PARENT_SCOPE )
message(STATUS "Target triple: ${value}")
-endfunction( get_target_triple var )
+endfunction( get_host_triple var )
OpenPOWER on IntegriCloud