summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2024-02-03 22:21:26 +0100
committerArthur LAURENT <[email protected]>2024-02-03 22:22:56 +0100
commitfa0d8835aeae4905ce607d84cb15dd23bcaa19ce (patch)
tree2d08a39499fc1c1fb031e6f245b9a5311e54b1d8 /xmake/rules/c++/modules/modules_support
parenta393c0a2d41c22514769ec270818a599c2b9008f (diff)
fix recompilation for gcc
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc/builder.lua29
1 files changed, 15 insertions, 14 deletions
diff --git a/xmake/rules/c++/modules/modules_support/gcc/builder.lua b/xmake/rules/c++/modules/modules_support/gcc/builder.lua
index c90fe743e..ae3ed2d95 100644
--- a/xmake/rules/c++/modules/modules_support/gcc/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc/builder.lua
@@ -222,13 +222,6 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, should_build,
local compinst = compiler.load("cxx", {target = target})
local compflags = compinst:compflags({sourcefile = opt.cppfile, target = target})
- -- generate and append module mapper file
- local module_mapper
- if provide or opt.module.requires then
- module_mapper = _generate_modulemapper_file(target, opt.module)
- target:fileconfig_add(opt.cppfile, {force = {cxxflags = {module_mapperflag .. module_mapper}}})
- end
-
local build = should_build(target, opt.cppfile, bmifile, {objectfile = opt.objectfile, requires = opt.module.requires})
-- needed to detect rebuild of dependencies
@@ -236,6 +229,13 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, should_build,
mark_build(target, name)
end
+ -- generate and append module mapper file
+ local module_mapper
+ if provide or opt.module.requires then
+ module_mapper = _generate_modulemapper_file(target, opt.module)
+ target:fileconfig_add(opt.cppfile, {force = {cxxflags = {module_mapperflag .. module_mapper}}})
+ end
+
local dependfile = target:dependfile(bmifile or opt.objectfile)
local dependinfo = depend.load(dependfile) or {}
dependinfo.files = {}
@@ -266,15 +266,9 @@ end
function make_module_buildcmds(target, batchcmds, should_build, mark_build, opt)
local name, provide, _ = compiler_support.get_provided_module(opt.module)
+ local bmifile = provide and compiler_support.get_bmi_path(provide.bmi)
local module_mapperflag = compiler_support.get_modulemapperflag(target)
- -- generate and append module mapper file
- local module_mapper
- if provide or opt.module.requires then
- module_mapper = _generate_modulemapper_file(target, opt.module)
- target:fileconfig_add(opt.cppfile, {force = {cxxflags = {module_mapperflag .. module_mapper}}})
- end
-
local build = should_build(target, opt.cppfile, bmifile, {objectfile = opt.objectfile, requires = opt.module.requires})
-- needed to detect rebuild of dependencies
@@ -282,6 +276,13 @@ function make_module_buildcmds(target, batchcmds, should_build, mark_build, opt)
mark_build(target, name)
end
+ -- generate and append module mapper file
+ local module_mapper
+ if provide or opt.module.requires then
+ module_mapper = _generate_modulemapper_file(target, opt.module)
+ target:fileconfig_add(opt.cppfile, {force = {cxxflags = {module_mapperflag .. module_mapper}}})
+ end
+
if build then
-- compile if it's a named module
if provide or compiler_support.has_module_extension(opt.cppfile) then