summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/builder.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-11-10 09:14:53 +0800
committerGitHub <[email protected]>2025-11-10 09:14:53 +0800
commita88e94ae38116fc6d3ebd8c29b4da99b904ca699 (patch)
treefb94ad68d29ae66a96253f0df5042a1c4cf4e21f /xmake/rules/c++/modules/builder.lua
parent7aba463e126cac47359e97fb885f6d42ce98182c (diff)
parentdc0296c27bfd695f21670f7231e06def546e91c9 (diff)
Merge pull request #7004 from Arthapz/dont-rebuild-packages-and-std
feat(modules) Dont rebuild packages and std when using -r flag
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?