summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2023-06-20 22:58:46 +0800
committerruki <[email protected]>2023-06-20 22:58:46 +0800
commit945df4a01a9f2a88380138884b5c62e4fedf86be (patch)
treee78134058c169b8777bc34f84d25f3d275569631 /xmake/rules/c++/modules
parent558afe6d4272c7f0471e484cec2345635620793d (diff)
add modules.cxx11abi policy for gcc #3855
Diffstat (limited to 'xmake/rules/c++/modules')
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua
index a528a57ae..3c509edf5 100644
--- a/xmake/rules/c++/modules/modules_support/gcc.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc.lua
@@ -73,8 +73,14 @@ function load(target)
os.rm(_get_module_mapper(target))
end
target:add("cxxflags", {modulesflag, modulemapperflag .. path.translate(_get_module_mapper(target))}, {force = true, expand = false})
- -- fix cxxabi issue, @see https://github.com/xmake-io/xmake/issues/2716#issuecomment-1225057760
- target:add("cxxflags", "-D_GLIBCXX_USE_CXX11_ABI=0")
+ -- fix cxxabi issue
+ -- @see https://github.com/xmake-io/xmake/issues/2716#issuecomment-1225057760
+ -- https://github.com/xmake-io/xmake/issues/3855
+ if target:policy("build.c++.gcc.modules.cxx11abi") then
+ target:add("cxxflags", "-D_GLIBCXX_USE_CXX11_ABI=1")
+ else
+ target:add("cxxflags", "-D_GLIBCXX_USE_CXX11_ABI=0")
+ end
end
-- get includedirs for stl headers