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/modules_support/common.lua | |
| parent | e4179556134ffba995299eb3e949c48ad80d8678 (diff) | |
Do not insert duplicate header unit
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/common.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/common.lua | 8 |
1 files changed, 6 insertions, 2 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 |
