1 # Returns the host triple.
4 function( get_target_triple var )
7 set( value "x86_64-pc-win32" )
9 set( value "i686-pc-win32" )
11 elseif( MINGW AND NOT MSYS )
12 if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
13 set( value "x86_64-w64-mingw32" )
15 set( value "i686-pc-mingw32" )
18 set(config_guess ${LLVM_MAIN_SRC_DIR}/autoconf/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 message(STATUS "Target triple: ${value}")
30 endfunction( get_target_triple var )