From fd0512ecccfc30a82356747e106ed98db45ae0cf Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 26 Dec 2025 22:34:13 +0800 Subject: disable c++23preview for clang-cl --- xmake/modules/core/tools/cl.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 240189e4c..e5f8f7eaf 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -267,6 +267,13 @@ function nf_language(self, stdname) -- the stdc++ maps if _g.cxxmaps == nil then + -- clang-cl with c++23preview does not work for c++ modules + -- https://github.com/xmake-io/xmake/issues/7169 + local cxx23 = {"-std:c++23", "-std:c++23preview", "-std:c++latest"} + if self:name() == "clang_cl" then + cxx23 = {"-std:c++23", "-std:c++latest"} + end + local cxx2b = cxx23 _g.cxxmaps = { cxx11 = "-std:c++11" @@ -281,10 +288,10 @@ function nf_language(self, stdname) , gnuxx20 = {"-std:c++20", "-std:c++latest"} , cxx2a = {"-std:c++20", "-std:c++latest"} , gnuxx2a = {"-std:c++20", "-std:c++latest"} - , cxx23 = {"-std:c++23", "-std:c++23preview", "-std:c++latest"} - , gnuxx23 = {"-std:c++23", "-std:c++23preview", "-std:c++latest"} - , cxx2b = {"-std:c++23", "-std:c++23preview", "-std:c++latest"} - , gnuxx2b = {"-std:c++23", "-std:c++23preview", "-std:c++latest"} + , cxx23 = cxx23 + , gnuxx23 = cxx23 + , cxx2b = cxx2b + , gnuxx2b = cxx2b , cxx26 = {"-std:c++26", "-std:c++latest"} , gnuxx26 = {"-std:c++26", "-std:c++latest"} , cxxlatest = "-std:c++latest" -- cgit v1.3.1