[libcxx] [llvm] [libcxx][llvm]: Fix misidentification of GNU-style clang as clang-cl (PR #225124)
Jacob Abel via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 27 14:10:34 PDT 2026
https://github.com/OneDeuxTriSeiGo updated https://github.com/llvm/llvm-project/pull/225124
>From 93b261436572e4caab9a7f162c8dc12527951670 Mon Sep 17 00:00:00 2001
From: Jacob Abel <jacobabel at nullpo.dev>
Date: Mon, 21 Sep 2026 11:46:45 -0400
Subject: [PATCH 1/2] [llvm]: Fix misidentification of GNU-style clang as
clang-cl
Signed-off-by: Jacob Abel <jacobabel at nullpo.dev>
---
llvm/cmake/modules/CheckCompilerVersion.cmake | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/llvm/cmake/modules/CheckCompilerVersion.cmake b/llvm/cmake/modules/CheckCompilerVersion.cmake
index c550df7b08c84..bf2919ad08aa2 100644
--- a/llvm/cmake/modules/CheckCompilerVersion.cmake
+++ b/llvm/cmake/modules/CheckCompilerVersion.cmake
@@ -68,7 +68,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if (CMAKE_CXX_SIMULATE_VERSION VERSION_LESS MSVC_MIN)
message(FATAL_ERROR "Host Clang must have at least -fms-compatibility-version=${MSVC_MIN}, your version is ${CMAKE_CXX_SIMULATE_VERSION}.")
endif()
- set(CLANG_CL 1)
+ if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT MATCHES "MSVC")
+ set(CLANG_CL 1)
+ endif()
elseif(NOT LLVM_ENABLE_LIBCXX)
# Test that we aren't using too old of a version of libstdc++.
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
>From aaad35a3876eba9c336449cb9a0012978e45a00e Mon Sep 17 00:00:00 2001
From: Jacob Abel <jacobabel at nullpo.dev>
Date: Sun, 27 Sep 2026 17:09:12 -0400
Subject: [PATCH 2/2] [libcxx]: Fix misidentification of GNU-style clang as
clang-cl
Signed-off-by: Jacob Abel <jacobabel at nullpo.dev>
---
libcxx/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index d163f0f579c39..4f9e2eac01c55 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -43,7 +43,7 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
"${PROJECT_NAME} requires an out of source build. Please create a separate
build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
)
-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND "${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC")
message(STATUS "Configuring for clang-cl")
set(LIBCXX_TARGETING_CLANG_CL ON)
endif()
More information about the llvm-commits
mailing list