summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/gcc.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2022-12-07 02:05:30 +0100
committerArthur LAURENT <[email protected]>2022-12-07 02:05:30 +0100
commite255ae47f8f8ddacf01a038b47338de00edc06e0 (patch)
treed47ab858798598c45fa485bf24551a1eaf08dff2 /xmake/rules/c++/modules/modules_support/gcc.lua
parente33abe52706c9007aa2d29b10e92512a07d2b142 (diff)
parentefdbbaa5f2ba912e923bf828d66cbd144ca341bd (diff)
Merge remote-tracking branch 'origin/fix-gcc-link-module-order' into fix-module-link-order
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/gcc.lua')
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua
index 7c7db66e8..8912bb60e 100644
--- a/xmake/rules/c++/modules/modules_support/gcc.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc.lua
@@ -67,10 +67,11 @@ end
-- load module support for the current target
function load(target)
local modulesflag = get_modulesflag(target)
- target:add("cxxflags", modulesflag)
+ local modulemapperflag = get_modulemapperflag(target)
if os.isfile(_get_module_mapper(target)) then
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")
end
@@ -493,7 +494,7 @@ function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, op
break
end
end
- local flags = {"-x", "c++", modulemapperflag .. path.translate(_get_module_mapper(target)),"-c", path(cppfile), "-o", path(objectfile)}
+ local flags = {"-x", "c++", "-c", path(cppfile), "-o", path(objectfile)}
batchcmds:show_progress(opt.progress, "${color.build.object}compiling.module.$(mode) %s", name or cppfile)
batchcmds:mkdir(path.directory(objectfile))
batchcmds:vrunv(compinst:program(), table.join(compinst:compflags({target = target}), flags))