summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-11-26 22:54:32 +0800
committerGitHub <[email protected]>2024-11-26 22:54:32 +0800
commit7bdfaf44792d6af75081a3a8316515dc72dca0d6 (patch)
tree48fb35819778e566371b6434faec84598686b541
parentf4599d3129cf4025174a58e20c9402687e73bb78 (diff)
parent6f558c50a9b5fd82fe4e45290a257b77c06a158a (diff)
Merge pull request #5887 from xmake-io/modules
fix gcc modules
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc/compiler_support.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/xmake/rules/c++/modules/modules_support/gcc/compiler_support.lua b/xmake/rules/c++/modules/modules_support/gcc/compiler_support.lua
index f23beb20a..72de29081 100644
--- a/xmake/rules/c++/modules/modules_support/gcc/compiler_support.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc/compiler_support.lua
@@ -60,8 +60,7 @@ function load(target)
-- @see https://github.com/xmake-io/xmake/issues/2716#issuecomment-1225057760
-- https://github.com/xmake-io/xmake/issues/3855
- -- libstdc++ std modules cannot compile with -D_GLIBCXX_USE_CXX11_ABI=0
- if target:policy("build.c++.modules.std") or target:policy("build.c++.gcc.modules.cxx11abi") then
+ 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")
@@ -158,12 +157,12 @@ end
function get_stdmodules(target)
if not target:policy("build.c++.modules.std") then
- return nil
+ return
end
local modules_json_path = _get_std_module_manifest_path(target)
if not modules_json_path then
- return nil
+ return
end
local modules_json = json.loadfile(modules_json_path)