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

Daniel Kiss via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 07:15:43 PST 2025


https://github.com/DanielKristofKiss created https://github.com/llvm/llvm-project/pull/122914

CMAKE_CXX_SIMULATE_ID indicates the MSCV abi is usable.

>From 8305a944bf669e5b7390842867ab60fec982e4b2 Mon Sep 17 00:00:00 2001
From: Daniel Kiss <daniel.kiss at arm.com>
Date: Tue, 14 Jan 2025 14:42:43 +0000
Subject: [PATCH] Simplify MSVC compatible compiler detection.

CMAKE_CXX_SIMULATE_ID indicates the MSCV abi is usable.

Change-Id: I6112f7282400c45b140c44c3f46ac7ea8f97c9ee
---
 llvm/cmake/modules/GetHostTriple.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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