diff options
| author | Arthur LAURENT <[email protected]> | 2025-08-12 10:22:39 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2025-08-12 10:22:39 +0200 |
| commit | 4a07f767a33e03b234408ab8db1269355363f196 (patch) | |
| tree | 450b98a1d9be5088c0a03bf60429da71b5e1f066 /xmake/rules/c++/modules/mapper.lua | |
| parent | 4f16fd80688304613bdb06e26f8f02bc30183b32 (diff) | |
fix(c++ modules) handle empty modules
Diffstat (limited to 'xmake/rules/c++/modules/mapper.lua')
| -rw-r--r-- | xmake/rules/c++/modules/mapper.lua | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/xmake/rules/c++/modules/mapper.lua b/xmake/rules/c++/modules/mapper.lua index db709192c..d8e9075b4 100644 --- a/xmake/rules/c++/modules/mapper.lua +++ b/xmake/rules/c++/modules/mapper.lua @@ -85,16 +85,18 @@ function feed(target, modules, sourcefiles) local reused, from = support.is_reused(target, sourcefile) if reused then local module = get(from, sourcefile) - mapper[module.name] = module - for dep_name, dep_module in pairs(module.deps) do - if dep_module.headerunit then - local key = dep_name .. dep_module.key - mapper[key] = get(from, key) - local sourcefile = mapper[key].sourcefile - mapper[sourcefile .. dep_module.key] = table.clone(mapper[key]) - mapper[sourcefile .. dep_module.key].alias = false - end - end + if module.name then + mapper[module.name] = module + for dep_name, dep_module in pairs(module.deps) do + if dep_module.headerunit then + local key = dep_name .. dep_module.key + mapper[key] = get(from, key) + local sourcefile = mapper[key].sourcefile + mapper[sourcefile .. dep_module.key] = table.clone(mapper[key]) + mapper[sourcefile .. dep_module.key].alias = false + end + end + end end end end |
