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 set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
19 execute_process(COMMAND sh ${config_guess}
21 OUTPUT_VARIABLE TT_OUT
22 OUTPUT_STRIP_TRAILING_WHITESPACE)
23 if( NOT TT_RV EQUAL 0 )
24 message(FATAL_ERROR "Failed to execute ${config_guess}")
25 endif( NOT TT_RV EQUAL 0 )
26 set( value ${TT_OUT} )
28 set( ${var} ${value} PARENT_SCOPE )
29 endfunction( get_host_triple var )