summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/scanner.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-05-18 17:00:48 +0200
committerArthur LAURENT <[email protected]>2025-05-18 17:00:48 +0200
commite8a3f1e2e212990c9cae7b7702c0d0977e2a3ac5 (patch)
treec21a16b1742b935a3cea0e34729f4ca51322ac4f /xmake/rules/c++/modules/scanner.lua
parent3148ec6aad6d665af4cbad310b3cba128038b8ff (diff)
(C++ modules support) fix incremental build
Diffstat (limited to 'xmake/rules/c++/modules/scanner.lua')
-rw-r--r--xmake/rules/c++/modules/scanner.lua6
1 files 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 = {}