1 # Returns the host triple.
4 function( get_host_triple var )
6 if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
7 set( value "x86_64-pc-windows-msvc" )
9 set( value "i686-pc-windows-msvc" )
11 elseif( MINGW AND NOT MSYS )
12 if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
13 set( value "x86_64-w64-windows-gnu" )
15 set( value "i686-pc-windows-gnu" )
18 if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows AND NOT MSYS)
19 message(WARNING "unable to determine host target triple")
21 set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
22 execute_process(COMMAND sh ${config_guess}
24 OUTPUT_VARIABLE TT_OUT
25 OUTPUT_STRIP_TRAILING_WHITESPACE)
26 if( NOT TT_RV EQUAL 0 )
27 message(FATAL_ERROR "Failed to execute ${config_guess}")
28 endif( NOT TT_RV EQUAL 0 )
29 # Defer to dynamic detection of the host AIX version.
30 string(REGEX REPLACE "-aix[0-9][^-]*" "-aix" value ${TT_OUT})
33 set( ${var} ${value} PARENT_SCOPE )
34 endfunction( get_host_triple var )