From 279689863b3ced10d7d1639b77ec57c70db11fde Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Fri, 5 Aug 2022 05:33:21 +0200 Subject: Do not insert duplicate header unit --- xmake/rules/c++/modules/modules_support/common.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'xmake/rules/c++/modules/modules_support/common.lua') 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 -- cgit v1.3.1