From e8a3f1e2e212990c9cae7b7702c0d0977e2a3ac5 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Sun, 18 May 2025 17:00:48 +0200 Subject: (C++ modules support) fix incremental build --- xmake/rules/c++/modules/scanner.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xmake/rules/c++/modules/scanner.lua b/xmake/rules/c++/modules/scanner.lua index 0fd0b212e..9e95f3cfd 100644 --- a/xmake/rules/c++/modules/scanner.lua +++ b/xmake/rules/c++/modules/scanner.lua @@ -362,6 +362,7 @@ end -- patch sourcebatch function _patch_sourcebatch(target, sourcebatch) + local memcache = support.memcache() -- target deps modules local depsmodules = _get_targetdeps_modules(target) or {} @@ -369,7 +370,8 @@ function _patch_sourcebatch(target, sourcebatch) local pkgmodules = _get_packages_modules(target) or {} local externalmodules = table.join(depsmodules, pkgmodules) - local keys = #externalmodules > 0 and table.concat(table.orderkeys(externalmodules)) or " " + local keys = #sourcebatch.sourcefiles > 0 and table.concat(sourcebatch.sourcefiles) or " " + keys = keys .. (#externalmodules > 0 and table.concat(table.orderkeys(externalmodules)) or " ") local md5sum = hash.md5(bytes(keys)) local localcache = support.localcache() local cached_patched_sourcebatch = localcache:get2(target:fullname(), "patched_sourcebatch") @@ -396,8 +398,8 @@ function _patch_sourcebatch(target, sourcebatch) end table.insert(sourcebatch.sourcefiles, sourcefile) target:fileconfig_add(sourcefile, fileconfig) + memcache:set2(target:fullname(), "modules.changed", true) end - sourcebatch.sourcekind = "cxx" sourcebatch.objectfiles = {} sourcebatch.dependfiles = {} -- cgit v1.3.1