diff options
| author | Arthur LAURENT <[email protected]> | 2025-04-23 18:40:13 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2025-04-23 18:40:13 +0200 |
| commit | a26ab0a2df198a1af1c3a68d63fd16b042b01486 (patch) | |
| tree | 2f1a05acfc39d8f49ee738ef6bcbc148cec7f2c6 /xmake/rules/c++/modules/gcc/support.lua | |
| parent | d60e9b244f091593232fffae837ec0504c51f032 (diff) | |
(C++ modules support) improve modules policy naming
Diffstat (limited to 'xmake/rules/c++/modules/gcc/support.lua')
| -rw-r--r-- | xmake/rules/c++/modules/gcc/support.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/gcc/support.lua b/xmake/rules/c++/modules/gcc/support.lua index 52d8af79f..792e975f5 100644 --- a/xmake/rules/c++/modules/gcc/support.lua +++ b/xmake/rules/c++/modules/gcc/support.lua @@ -60,7 +60,9 @@ function load(target) -- @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 + local cxx11abi = target:policy("build.c++.modules.gcc.cxx11abi") or + target:policy("build.c++.gcc.modules.cxx11abi") + if cxx11abi then target:add("cxxflags", "-D_GLIBCXX_USE_CXX11_ABI=1") else target:add("cxxflags", "-D_GLIBCXX_USE_CXX11_ABI=0") @@ -81,7 +83,9 @@ function strip_flags(target, flags) "-Q", "-fmodule-mapper", } - if not target:policy("build.c++.modules.tryreuse.discriminate_on_defines") then + local strict = target:policy("build.c++.modules.reuse.strict") or + target:policy("build.c++.modules.tryreuse.discriminate_on_defines") + if not strict then table.join2(strippable_flags, {"-D", "-U"}) end local output = {} |
