mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
build: don't attempt to run config.guess on Windows
When cross-compiling LLVM to android from Windows (for LLVMSupport), we would attempt to execute `config.guess` to determine the host triple since `CMAKE_SYSTEM_NAME` is not Windows and `CMAKE_C_COMPILER` will be set to GNU or Clang. This will fail as `config.guess` is a shell script which cannot be executed on Windows. Simply log a warning instead. The user can specify the value for this instead in those cases. llvm-svn: 363420
This commit is contained in:
parent
8ac3784ab2
commit
16f4f43d09
@ -15,16 +15,20 @@ function( get_host_triple var )
|
||||
set( value "i686-pc-windows-gnu" )
|
||||
endif()
|
||||
else( MSVC )
|
||||
set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
|
||||
execute_process(COMMAND sh ${config_guess}
|
||||
RESULT_VARIABLE TT_RV
|
||||
OUTPUT_VARIABLE TT_OUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if( NOT TT_RV EQUAL 0 )
|
||||
message(FATAL_ERROR "Failed to execute ${config_guess}")
|
||||
endif( NOT TT_RV EQUAL 0 )
|
||||
# Defer to dynamic detection of the host AIX version.
|
||||
string(REGEX REPLACE "-aix[0-9][^-]*" "-aix" value ${TT_OUT})
|
||||
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
|
||||
message(WARNING "unable to determine host target triple")
|
||||
else()
|
||||
set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
|
||||
execute_process(COMMAND sh ${config_guess}
|
||||
RESULT_VARIABLE TT_RV
|
||||
OUTPUT_VARIABLE TT_OUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if( NOT TT_RV EQUAL 0 )
|
||||
message(FATAL_ERROR "Failed to execute ${config_guess}")
|
||||
endif( NOT TT_RV EQUAL 0 )
|
||||
# Defer to dynamic detection of the host AIX version.
|
||||
string(REGEX REPLACE "-aix[0-9][^-]*" "-aix" value ${TT_OUT})
|
||||
endif()
|
||||
endif( MSVC )
|
||||
set( ${var} ${value} PARENT_SCOPE )
|
||||
endfunction( get_host_triple var )
|
||||
|
Loading…
Reference in New Issue
Block a user