[libcxx-commits] [libcxx] [libcxx]CMake Condition for Clang with MSVC frontend being incorrect (PR #194258)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Apr 26 12:52:45 PDT 2026
https://github.com/trcrsired created https://github.com/llvm/llvm-project/pull/194258
Try to deal with issue #190257
The code assumes CMAKE_CXX_SIMULATE_ID begin always clang-cl which is untrue because we can use clang --target=${cpu}-windows-msvc.
>From 26986336ba2a947f298e1b5fcc554b1f76e53e56 Mon Sep 17 00:00:00 2001
From: cqwrteur <oyzawqgcfc at gmail.com>
Date: Mon, 27 Apr 2026 03:51:25 +0800
Subject: [PATCH] CMake Condition for Clang with MSVC frontend being incorrect
The old code assumes CMAKE_CXX_SIMULATE_ID is always clang-cl which is untrue because we can use clang --target=${cpu}-windows-msvc.
---
libcxx/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 845240d1b894c..8562fa9f90ae2 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -35,7 +35,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 libcxx-commits
mailing list