1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

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
This commit is contained in:
Chandler Carruth 2012-01-24 18:00:44 +00:00
parent f3607eac5d
commit f26c121c21
3 changed files with 9 additions and 6 deletions

View File

@ -287,15 +287,18 @@ include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG) check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)
include(GetTargetTriple) include(GetHostTriple)
get_target_triple(LLVM_DEFAULT_TARGET_TRIPLE) 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}") set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
# Determine the native architecture. # Determine the native architecture.
string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH) string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH)
if( LLVM_NATIVE_ARCH STREQUAL "host" ) 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 () endif ()
if (LLVM_NATIVE_ARCH MATCHES "i[2-6]86") if (LLVM_NATIVE_ARCH MATCHES "i[2-6]86")

View File

@ -32,6 +32,6 @@ install(DIRECTORY .
PATTERN LLVMConfig.cmake EXCLUDE PATTERN LLVMConfig.cmake EXCLUDE
PATTERN LLVMConfigVersion.cmake EXCLUDE PATTERN LLVMConfigVersion.cmake EXCLUDE
PATTERN LLVM-Config.cmake EXCLUDE PATTERN LLVM-Config.cmake EXCLUDE
PATTERN GetTargetTriple.cmake EXCLUDE PATTERN GetHostTriple.cmake EXCLUDE
PATTERN VersionFromVCS.cmake EXCLUDE PATTERN VersionFromVCS.cmake EXCLUDE
PATTERN CheckAtomic.cmake EXCLUDE) PATTERN CheckAtomic.cmake EXCLUDE)

View File

@ -1,7 +1,7 @@
# Returns the host triple. # Returns the host triple.
# Invokes config.guess # Invokes config.guess
function( get_target_triple var ) function( get_host_triple var )
if( MSVC ) if( MSVC )
if( CMAKE_CL_64 ) if( CMAKE_CL_64 )
set( value "x86_64-pc-win32" ) set( value "x86_64-pc-win32" )
@ -27,4 +27,4 @@ function( get_target_triple var )
endif( MSVC ) endif( MSVC )
set( ${var} ${value} PARENT_SCOPE ) set( ${var} ${value} PARENT_SCOPE )
message(STATUS "Target triple: ${value}") message(STATUS "Target triple: ${value}")
endfunction( get_target_triple var ) endfunction( get_host_triple var )