Skip to content

Commit e8a3f1e

Browse files
committed
(C++ modules support) fix incremental build
1 parent 3148ec6 commit e8a3f1e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xmake/rules/c++/modules/scanner.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,16 @@ end
362362
-- patch sourcebatch
363363
function _patch_sourcebatch(target, sourcebatch)
364364

365+
local memcache = support.memcache()
365366
-- target deps modules
366367
local depsmodules = _get_targetdeps_modules(target) or {}
367368

368369
-- package modules
369370
local pkgmodules = _get_packages_modules(target) or {}
370371

371372
local externalmodules = table.join(depsmodules, pkgmodules)
372-
local keys = #externalmodules > 0 and table.concat(table.orderkeys(externalmodules)) or " "
373+
local keys = #sourcebatch.sourcefiles > 0 and table.concat(sourcebatch.sourcefiles) or " "
374+
keys = keys .. (#externalmodules > 0 and table.concat(table.orderkeys(externalmodules)) or " ")
373375
local md5sum = hash.md5(bytes(keys))
374376
local localcache = support.localcache()
375377
local cached_patched_sourcebatch = localcache:get2(target:fullname(), "patched_sourcebatch")
@@ -396,8 +398,8 @@ function _patch_sourcebatch(target, sourcebatch)
396398
end
397399
table.insert(sourcebatch.sourcefiles, sourcefile)
398400
target:fileconfig_add(sourcefile, fileconfig)
401+
memcache:set2(target:fullname(), "modules.changed", true)
399402
end
400-
401403
sourcebatch.sourcekind = "cxx"
402404
sourcebatch.objectfiles = {}
403405
sourcebatch.dependfiles = {}

0 commit comments

Comments
 (0)