Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/cmake/modules/GetHostTriple.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Invokes config.guess

function( get_host_triple var )
if( MSVC )
if(MSVC OR (CMAKE_HOST_SYSTEM_NAME STREQUAL Windows AND CMAKE_C_COMPILER_ID MATCHES "Clang"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't about CMAKE_HOST_SYSTEM_NAME, it's about the target, so we should check CMAKE_SYSTEM_NAME instead - to make it work as expected and intended for cross compilation.

The existing check below which checks CMAKE_HOST_SYSTEM_NAME is for determining whether it will be possible to execute a shell script, where we do need to check the host environment.

if( CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "ARM64.*" )
set( value "aarch64-pc-windows-msvc" )
elseif( CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "ARM.*" )
Expand Down Expand Up @@ -41,7 +41,7 @@ function( get_host_triple var )
else()
set( value "powerpc-ibm-aix" )
endif()
else( MSVC )
else()
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows AND NOT MSYS)
message(WARNING "unable to determine host target triple")
else()
Expand Down
Loading