summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/scanner.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/scanner.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/scanner.lua')
-rw-r--r--xmake/rules/c++/modules/scanner.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/rules/c++/modules/scanner.lua b/xmake/rules/c++/modules/scanner.lua
index 3c7a04aa4..12c85e73e 100644
--- a/xmake/rules/c++/modules/scanner.lua
+++ b/xmake/rules/c++/modules/scanner.lua
@@ -510,7 +510,11 @@ end
function _do_scan(target, sourcefile, opt)
profiler.enter(target:fullname(), "c++ modules", "scanner", "scan dependencies for", sourcefile)
- local changed = _scanner(target).scan_dependency_for(target, sourcefile, opt)
+ local fileconfig = target:fileconfig(sourcefile)
+ local from_package = fileconfig and fileconfig.from_package
+ local is_std = path.basename(sourcefile) == "std" or path.basename(sourcefile) == "std.compat"
+ local rescan = target:is_rebuilt() and not from_package and not is_std
+ local changed = _scanner(target).scan_dependency_for(target, sourcefile, rescan, opt)
if changed or not support.localcache():get2(target:fullname(), "module_mapper") then
support.memcache():set2(target:fullname(), "modules.changed", true)
end