Skip to content

Commit bcafeff

Browse files
authored
Merge pull request #6450 from Arthapz/optimize-module-support
(C++ modules support) Optimize module scanner
2 parents 25b22ca + e8a3f1e commit bcafeff

File tree

4 files changed

+281
-202
lines changed

4 files changed

+281
-202
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ function main(target)
7676
target:add("files")
7777
end
7878

79+
local memcache = support.memcache()
80+
local targets = memcache:get("targets") or {}
81+
targets[target:fullname()] = {}
82+
targets[target:fullname()].finished_parsing = false
83+
memcache:set("targets", targets)
7984
-- moduleonly modules are implicitly public
8085
if target:is_moduleonly() then
8186
local sourcebatches = target:sourcebatches()

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ end
4747
function feed(target, modules, sourcefiles)
4848

4949
local mapper = get_mapper_for(target, {invalidate = true})
50-
local localcache = support.localcache()
5150
local deps_names = hashset.new()
5251
local deps_names_map = {}
5352
local headerunit_aliases = {}
@@ -110,8 +109,6 @@ function feed(target, modules, sourcefiles)
110109
mapper[name] = _module
111110
end
112111
end
113-
114-
localcache:save()
115112
end
116113

117114
-- get a module from target mapper by name

0 commit comments

Comments
 (0)