From c8f60856c4c998f3d4894524ba1576f8da43baa7 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 29 Sep 2023 21:03:07 +0800 Subject: improve links --- xmake/core/tool/builder.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'xmake/core/tool/builder.lua') diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua index d2ce4aca6..b8ef3a0df 100644 --- a/xmake/core/tool/builder.lua +++ b/xmake/core/tool/builder.lua @@ -502,14 +502,17 @@ function builder:_sort_links_of_items(target, items) end from = to end + local links_set = hashset.from(links) for _, linkorder in ipairs(linkorders) do local from for _, link in ipairs(linkorder) do - local to = link - if from and to then - gh:add_edge(from, to) + if links_set:has(link) then + local to = link + if from and to then + gh:add_edge(from, to) + end + from = to end - from = to end end if not gh:empty() then -- cgit v1.3.1