PageRenderTime 113ms CodeModel.GetById 111ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/3rd_party/llvm/cmake/modules/GetTargetTriple.cmake

https://code.google.com/p/softart/
CMake | 30 lines | 27 code | 1 blank | 2 comment | 4 complexity | feb31b586e1ff94c969406aa39b97752 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause, JSON, MPL-2.0-no-copyleft-exception, GPL-2.0, GPL-3.0, LGPL-3.0, BSD-2-Clause
 1# Returns the host triple.
 2# Invokes config.guess
 3
 4function( get_target_triple var )
 5  if( MSVC )
 6    if( CMAKE_CL_64 )
 7      set( value "x86_64-pc-win32" )
 8    else()
 9      set( value "i686-pc-win32" )
10    endif()
11  elseif( MINGW AND NOT MSYS )
12    if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
13      set( value "x86_64-w64-mingw32" )
14    else()
15      set( value "i686-pc-mingw32" )
16    endif()
17  else( MSVC )
18    set(config_guess ${LLVM_MAIN_SRC_DIR}/autoconf/config.guess)
19    execute_process(COMMAND sh ${config_guess}
20      RESULT_VARIABLE TT_RV
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} )
27  endif( MSVC )
28  set( ${var} ${value} PARENT_SCOPE )
29  message(STATUS "Target triple: ${value}")
30endfunction( get_target_triple var )