From dc0296c27bfd695f21670f7231e06def546e91c9 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Fri, 7 Nov 2025 23:23:54 +0100 Subject: (modules) don't rebuild packages and std module when using -r --- xmake/rules/c++/modules/builder.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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? -- cgit v1.3.1