summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/gcc/support.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-05-11 16:21:52 +0200
committerArthur LAURENT <[email protected]>2025-05-11 16:21:59 +0200
commit2c161e887cb5aeb6e2e3d4d0871a7380403e5e09 (patch)
treea480fc8e8a22c3d5d1383e615c6b9a084e03039e /xmake/rules/c++/modules/gcc/support.lua
parent22fcfc64078f4ad04a9ecf5af30adaf7dae199e5 (diff)
(C++ modules support) default cxx11abi to true when gcc version is >= 15
Diffstat (limited to 'xmake/rules/c++/modules/gcc/support.lua')
-rw-r--r--xmake/rules/c++/modules/gcc/support.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/xmake/rules/c++/modules/gcc/support.lua b/xmake/rules/c++/modules/gcc/support.lua
index bc924f35c..e6f8591a0 100644
--- a/xmake/rules/c++/modules/gcc/support.lua
+++ b/xmake/rules/c++/modules/gcc/support.lua
@@ -61,6 +61,13 @@ function load(target)
-- https://github.com/xmake-io/xmake/issues/3855
local cxx11abi = target:policy("build.c++.modules.gcc.cxx11abi") or
target:policy("build.c++.gcc.modules.cxx11abi")
+ if cxx11abi == nil then
+ -- enable cxx11abi on GCC >= 15 as it is required for C++23 module
+ local gcc_version = get_gcc_version(target)
+ if gcc_version and semver.compare(gcc_version, "15") > 0 then
+ cxx11abi = true
+ end
+ end
if cxx11abi then
target:add("cxxflags", "-D_GLIBCXX_USE_CXX11_ABI=1")
else