diff options
| author | Arthur LAURENT <[email protected]> | 2022-08-05 05:33:21 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2022-08-05 05:33:21 +0200 |
| commit | 279689863b3ced10d7d1639b77ec57c70db11fde (patch) | |
| tree | 07f3de6e756214ccf1cb2917263ae5de68bae1dd /xmake/rules/c++/modules | |
| parent | e4179556134ffba995299eb3e949c48ad80d8678 (diff) | |
Do not insert duplicate header unit
Diffstat (limited to 'xmake/rules/c++/modules')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/common.lua | 8 | ||||
| -rw-r--r-- | xmake/rules/c++/modules/xmake.lua | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index 18647ded1..8d3c8456d 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -68,10 +68,14 @@ function get_headerunits(target, sourcebatch) if stl_headers.is_stl_header(name) then stl_headerunits = stl_headerunits or {} - table.insert(stl_headerunits, {name = name, path = r.path, type = unittype}) + if not table.find_if(stl_headerunits, function(i, v) return v.name == name end) then + table.insert(stl_headerunits, {name = name, path = r.path, type = unittype}) + end else headerunits = headerunits or {} - table.insert(headerunits, {name = name, path = r.path, type = unittype}) + if not table.find_if(headerunits, function(i, v) return v.name == name end) then + table.insert(headerunits, {name = name, path = r.path, type = unittype}) + end end end end diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 45ba38ca8..4eae5f522 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -98,9 +98,6 @@ rule("c++.build.modules.builder") if stl_headerunits then headerunits_flags = headerunits_flags or {} table.join2(headerunits_flags, modules_support.generate_stl_headerunits(target, batchcmds, stl_headerunits, opt)) - - -- force STL header unit generation - batchcmds:runcmds(opt) end if headerunits then headerunits_flags = headerunits_flags or {} |
