[llvm] aa99006 - Simplify MSVC compatible compiler detection. (#122914)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 01:17:24 PST 2025


Author: Daniel Kiss
Date: 2025-01-16T10:17:19+01:00
New Revision: aa990069cf4ddd8546dbb36a7d2f157b7984c3b5

URL: https://github.com/llvm/llvm-project/commit/aa990069cf4ddd8546dbb36a7d2f157b7984c3b5
DIFF: https://github.com/llvm/llvm-project/commit/aa990069cf4ddd8546dbb36a7d2f157b7984c3b5.diff

LOG: Simplify MSVC compatible compiler detection. (#122914)

CMAKE_CXX_SIMULATE_ID indicates the MSVC abi is usable.

Added: 
    

Modified: 
    llvm/cmake/modules/GetHostTriple.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/GetHostTriple.cmake b/llvm/cmake/modules/GetHostTriple.cmake
index e58d5b1ef14d45..2a2f84ada098fd 100644
--- a/llvm/cmake/modules/GetHostTriple.cmake
+++ b/llvm/cmake/modules/GetHostTriple.cmake
@@ -2,7 +2,7 @@
 # Invokes config.guess
 
 function( get_host_triple var )
-  if( MSVC OR (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT MINGW AND NOT MSYS))
+  if( MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
     if( CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "ARM64.*" )
       set( value "aarch64-pc-windows-msvc" )
     elseif( CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "ARM.*" )


        


More information about the llvm-commits mailing list