SHA256
1
0
forked from pool/llvm
llvm/cmake-host-triple.patch
2013-07-04 11:56:15 +00:00

34 lines
1.3 KiB
Diff

Index: llvm-3.3/cmake/modules/GetHostTriple.cmake
===================================================================
--- llvm-3.3.orig/cmake/modules/GetHostTriple.cmake
+++ llvm-3.3/cmake/modules/GetHostTriple.cmake
@@ -15,15 +15,19 @@ function( get_host_triple var )
set( value "i686-pc-mingw32" )
endif()
else( MSVC )
- set(config_guess ${LLVM_MAIN_SRC_DIR}/autoconf/config.guess)
- execute_process(COMMAND sh ${config_guess}
- RESULT_VARIABLE TT_RV
- OUTPUT_VARIABLE TT_OUT
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- if( NOT TT_RV EQUAL 0 )
- message(FATAL_ERROR "Failed to execute ${config_guess}")
- endif( NOT TT_RV EQUAL 0 )
- set( value ${TT_OUT} )
+ if( NOT LLVM_HOST_TRIPLE )
+ set(config_guess ${LLVM_MAIN_SRC_DIR}/autoconf/config.guess)
+ execute_process(COMMAND sh ${config_guess}
+ RESULT_VARIABLE TT_RV
+ OUTPUT_VARIABLE TT_OUT
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if( NOT TT_RV EQUAL 0 )
+ message(FATAL_ERROR "Failed to execute ${config_guess}")
+ endif( NOT TT_RV EQUAL 0 )
+ set( value ${TT_OUT} )
+ else( LLVM_HOST_TRIPLE )
+ set( value ${LLVM_HOST_TRIPLE} )
+ endif( NOT LLVM_HOST_TRIPLE )
endif( MSVC )
set( ${var} ${value} PARENT_SCOPE )
message(STATUS "Target triple: ${value}")