summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/builder.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-11-07 23:23:54 +0100
committerArthur LAURENT <[email protected]>2025-11-07 23:23:54 +0100
commitdc0296c27bfd695f21670f7231e06def546e91c9 (patch)
treec9776887e921ef03af592b64e49d670c113739af /xmake/rules/c++/modules/builder.lua
parent067f395b418f64b29488184bd6bcec910b94e44d (diff)
(modules) don't rebuild packages and std module when using -r
Diffstat (limited to 'xmake/rules/c++/modules/builder.lua')
-rw-r--r--xmake/rules/c++/modules/builder.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/rules/c++/modules/builder.lua b/xmake/rules/c++/modules/builder.lua
index 87cd143f0..ae25d3063 100644
--- a/xmake/rules/c++/modules/builder.lua
+++ b/xmake/rules/c++/modules/builder.lua
@@ -179,7 +179,11 @@ function should_build(target, module)
local objectfile_exists = (module.headerunit or support.is_bmionly(target, module.sourcefile)) and true or os.isfile(module.objectfile)
dependinfo.lastmtime = (os.isfile(module.bmifile or module.objectfile) and objectfile_exists) and os.mtime(dependfile) or 0
- local old_dependinfo = target:is_rebuilt() and {} or (depend.load(dependfile) or {})
+ local fileconfig = target:fileconfig(module.sourcefile)
+ local from_package = fileconfig and fileconfig.from_package
+ local is_std = path.basename(module.sourcefile) == "std" or path.basename(module.sourcefile) == "std.compat"
+ local rebuild = target:is_rebuilt() and not from_package and not is_std
+ local old_dependinfo = rebuild and {} or (depend.load(dependfile) or {})
old_dependinfo.files = {module.sourcefile}
-- need build this object?