[PATCH] D22370: Respect LLVM_HOST_TRIPLE when manually specified

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 07:44:18 PDT 2016


beanz added a comment.

I very much believe you are doing something wrong.

Your description of the problem doesn't match the error message, and I can tell you that the solution *isn't* to make get_host_triple return anything that isn't actually the host triple.

This is the error you posted:

  CMake Error at cmake/modules/GetHostTriple.cmake:24 (message):

That code is only hit if MSVC is false. You're in the `else` block of an `if(MSVC)`. The problem is actually that `if(MSVC)` isn't really the right check. Can you give this patch a try?

  diff --git a/cmake/modules/GetHostTriple.cmake b/cmake/modules/GetHostTriple.cmake
  index 5de710c..e3ecc5d 100644
  --- a/cmake/modules/GetHostTriple.cmake
  +++ b/cmake/modules/GetHostTriple.cmake
  @@ -2,18 +2,18 @@
   # Invokes config.guess
   
   function( get_host_triple var )
  -  if( MSVC )
  -    if( CMAKE_CL_64 )
  -      set( value "x86_64-pc-win32" )
  -    else()
  -      set( value "i686-pc-win32" )
  -    endif()
  -  elseif( MINGW AND NOT MSYS )
  +  if( MINGW AND NOT MSYS )
       if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
         set( value "x86_64-w64-mingw32" )
       else()
         set( value "i686-pc-mingw32" )
       endif()
  +  elseif( CMAKE_HOST_WIN32 )
  +    if( CMAKE_CL_64 )
  +      set( value "x86_64-pc-win32" )
  +    else()
  +      set( value "i686-pc-win32" )
  +    endif()
     else( MSVC )
       set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
       execute_process(COMMAND sh ${config_guess}

-Chris


Repository:
  rL LLVM

https://reviews.llvm.org/D22370





More information about the llvm-commits mailing list