diff options
| -rw-r--r-- | xmake/rules/c++/modules/scanner.lua | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/xmake/rules/c++/modules/scanner.lua b/xmake/rules/c++/modules/scanner.lua index ff1c0f700..1bff7c787 100644 --- a/xmake/rules/c++/modules/scanner.lua +++ b/xmake/rules/c++/modules/scanner.lua @@ -458,6 +458,7 @@ function _do_computedag(target, modules, sourcebatch) local localcache = support.localcache() local memcache = support.memcache() local changed = memcache:get2(target:fullname(), "modules.changed") + if changed then localcache:set2(target:fullname(), "c++.modules", modules) mapper.feed(target, modules, sourcebatch.sourcefiles) @@ -483,17 +484,19 @@ function _do_computedag(target, modules, sourcebatch) cxx_sourcebatch.dependfiles = {} cxx_sourcebatch.objectfiles = {} for _, sourcefile in ipairs(sourcebatch.sourcefiles) do - local module = modules[sourcefile] - local insert = true - if module then - insert = not module.name - end + if not support.has_module_extension(sourcefile) then + local module = modules[sourcefile] + local insert = true + if module then + insert = not module.name + end - if insert then - table.insert(cxx_sourcebatch.sourcefiles, sourcefile) - local objectfile = target:objectfile(sourcefile) - table.insert(cxx_sourcebatch.dependfiles, target:dependfile(objectfile)) - table.insert(cxx_sourcebatch.objectfiles, objectfile) + if insert then + table.insert(cxx_sourcebatch.sourcefiles, sourcefile) + local objectfile = target:objectfile(sourcefile) + table.insert(cxx_sourcebatch.dependfiles, target:dependfile(objectfile)) + table.insert(cxx_sourcebatch.objectfiles, objectfile) + end end end localcache:set2(target:fullname(), "c++.build.sourcebatch", cxx_sourcebatch) |
