diff options
| author | Arthur LAURENT <[email protected]> | 2025-08-14 18:11:04 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2025-08-14 18:11:54 +0200 |
| commit | af4abe5c6611ddf7a583673a9c531dbfdcee42d2 (patch) | |
| tree | fb2bee3d85ad5f7c73dab0965026e3fe58bec5a1 /xmake/rules/c++/modules/scanner.lua | |
| parent | 84fcc1fd63aec5b6126f35806305326e4ecb936f (diff) | |
fix(c++ modules) fix non .cpp file stealed from c++.build sourcebatch
Diffstat (limited to 'xmake/rules/c++/modules/scanner.lua')
| -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) |
