Skip to content
Merged
Changes from all 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_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT MINGW AND NOT MSYS))
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, this if condition should be organized something like following:

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
    if(CMAKE_C_COMPILER_ID MATCHES "Clang")
        if(MSVC)
            message(STATUS "Clang is operating in MSVC mode (MSVC style driver: clang-cl).")
        elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID)
            message(STATUS "Clang is operating in MSVC mode (GNU style driver).")
        else()
            message(STATUS "Clang MinGW mode")
        endif()
    elseif(MSVC)
        message(STATUS "Compiler is MSVC (cl compiler).")
endif()

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, something like that would certainly be cleaner - but that would probably also be a much larger refactoring of the cmake code here.

Anyway, I'll accept the change here as I think this version should function correctly, but I don't mind such a restructuring either (maybe ideally as a separate step?).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll take care of that later, just first want to be sure all changes there to run all test, build everything fine. Not sure how much other changes needed... looking at it.

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