diff options
| author | Arthur LAURENT <[email protected]> | 2022-12-07 01:09:49 +0100 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2022-12-07 01:11:32 +0100 |
| commit | e33abe52706c9007aa2d29b10e92512a07d2b142 (patch) | |
| tree | 941dfdab1fa1d64516d9e4bf65a61280e5b7714a /xmake/rules/c++/modules/modules_support/gcc.lua | |
| parent | 425e4b9bfd3c3a457294998e3c8f0271b7a008a6 (diff) | |
| parent | b0f325733ca94d1f6286167144c3e3bc97082b31 (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.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua index a0843ba3b..7c7db66e8 100644 --- a/xmake/rules/c++/modules/modules_support/gcc.lua +++ b/xmake/rules/c++/modules/modules_support/gcc.lua @@ -67,12 +67,10 @@ end -- load module support for the current target function load(target) local modulesflag = get_modulesflag(target) - local modulemapperflag = get_modulemapperflag(target) target:add("cxxflags", modulesflag) if os.isfile(_get_module_mapper(target)) then os.rm(_get_module_mapper(target)) end - target:add("cxxflags", modulemapperflag .. path(_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 @@ -108,7 +106,8 @@ function _build_modulefile(target, sourcefile, opt) local objectfile = opt.objectfile local dependfile = opt.dependfile local compinst = compiler.load("cxx", {target = target}) - local compflags = table.join("-x", "c++", compinst:compflags({target = target})) + local modulemapperflag = get_modulemapperflag(target) + local compflags = table.join("-x", "c++", modulemapperflag .. path.translate(_get_module_mapper(target)), compinst:compflags({target = target})) local dependinfo = option.get("rebuild") and {} or (depend.load(dependfile) or {}) -- need build this object? @@ -456,6 +455,7 @@ end -- build module files for batchcmds function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, opt) local compinst = target:compiler("cxx") + local modulemapperflag = get_modulemapperflag(target) local mapper_file = _get_module_mapper(target) -- build modules @@ -493,7 +493,7 @@ function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, op break end end - local flags = {"-x", "c++","-c", path(cppfile), "-o", path(objectfile)} + local flags = {"-x", "c++", modulemapperflag .. path.translate(_get_module_mapper(target)),"-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)) |
