llvm.org GIT mirror llvm / 963f1cb
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363420 91177308-0d34-0410-b5e6-96231b3b80d8 Saleem Abdulrasool a month ago
1 changed file(s) with 14 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
1414 set( value "i686-pc-windows-gnu" )
1515 endif()
1616 else( MSVC )
17 set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
18 execute_process(COMMAND sh ${config_guess}
19 RESULT_VARIABLE TT_RV
20 OUTPUT_VARIABLE TT_OUT
21 OUTPUT_STRIP_TRAILING_WHITESPACE)
22 if( NOT TT_RV EQUAL 0 )
23 message(FATAL_ERROR "Failed to execute ${config_guess}")
24 endif( NOT TT_RV EQUAL 0 )
25 # Defer to dynamic detection of the host AIX version.
26 string(REGEX REPLACE "-aix[0-9][^-]*" "-aix" value ${TT_OUT})
17 if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
18 message(WARNING "unable to determine host target triple")
19 else()
20 set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
21 execute_process(COMMAND sh ${config_guess}
22 RESULT_VARIABLE TT_RV
23 OUTPUT_VARIABLE TT_OUT
24 OUTPUT_STRIP_TRAILING_WHITESPACE)
25 if( NOT TT_RV EQUAL 0 )
26 message(FATAL_ERROR "Failed to execute ${config_guess}")
27 endif( NOT TT_RV EQUAL 0 )
28 # Defer to dynamic detection of the host AIX version.
29 string(REGEX REPLACE "-aix[0-9][^-]*" "-aix" value ${TT_OUT})
30 endif()
2731 endif( MSVC )
2832 set( ${var} ${value} PARENT_SCOPE )
2933 endfunction( get_host_triple var )