summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-02-18 15:54:23 +0800
committerruki <[email protected]>2024-02-18 15:54:23 +0800
commitc3635e4b133a5f324419b4f7f5ebbdd2b53e56f8 (patch)
tree5c9196a36b6b8f26cdceac42307de120f7e6cd4e
parentb92d9b0ed1c41a85c37278d81662c6390913fc02 (diff)
fix incremental compilation for tests/ modules/package
-rw-r--r--xmake/rules/c++/modules/modules_support/builder.lua2
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc/builder.lua6
2 files changed, 3 insertions, 5 deletions
diff --git a/xmake/rules/c++/modules/modules_support/builder.lua b/xmake/rules/c++/modules/modules_support/builder.lua
index 77fe019cc..505ba07fb 100644
--- a/xmake/rules/c++/modules/modules_support/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/builder.lua
@@ -178,11 +178,9 @@ function should_build(target, sourcefile, bmifile, opt)
-- need build this object?
local depvalues = {compinst:program(), compflags}
local lastmtime = os.isfile(bmifile or objectfile) and os.mtime(dependfile) or 0
-
if dryrun or depend.is_changed(dependinfo, {lastmtime = lastmtime, values = depvalues}) then
return true
end
-
return false
end
diff --git a/xmake/rules/c++/modules/modules_support/gcc/builder.lua b/xmake/rules/c++/modules/modules_support/gcc/builder.lua
index cb5d3ef18..173c12fe2 100644
--- a/xmake/rules/c++/modules/modules_support/gcc/builder.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc/builder.lua
@@ -193,9 +193,6 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, opt)
end
end
- 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
@@ -210,6 +207,9 @@ function make_module_buildjobs(target, batchjobs, job_name, deps, opt)
mark_build(target, name)
end
+ local compinst = compiler.load("cxx", {target = target})
+ local compflags = compinst:compflags({sourcefile = opt.cppfile, target = target})
+
local dependfile = target:dependfile(bmifile or opt.objectfile)
local dependinfo = depend.load(dependfile) or {}
dependinfo.files = {}