From c3635e4b133a5f324419b4f7f5ebbdd2b53e56f8 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 18 Feb 2024 15:54:23 +0800 Subject: fix incremental compilation for tests/ modules/package --- xmake/rules/c++/modules/modules_support/builder.lua | 2 -- xmake/rules/c++/modules/modules_support/gcc/builder.lua | 6 +++--- 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 = {} -- cgit v1.3.1