From 067f395b418f64b29488184bd6bcec910b94e44d Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Fri, 7 Nov 2025 22:46:49 +0100 Subject: (modules) don't rescan std and packages modules when using -r --- xmake/rules/c++/modules/scanner.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xmake/rules/c++/modules/scanner.lua') 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 -- cgit v1.3.1