From f3298528cc2d3ae288c8df26bd14aa0b670ef316 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 23 Aug 2024 00:55:43 +0800 Subject: improve remove rpath --- xmake/modules/target/action/install/main.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/xmake/modules/target/action/install/main.lua b/xmake/modules/target/action/install/main.lua index 228cabd1a..257bdcedc 100644 --- a/xmake/modules/target/action/install/main.lua +++ b/xmake/modules/target/action/install/main.lua @@ -163,14 +163,12 @@ function _update_install_rpath(target, opt) for idx, rpathdirs in ipairs(result) do local source = sources[idx] local extraconf = target:extraconf_from("rpathdirs", source) - if extraconf then - for _, rpathdir in ipairs(rpathdirs) do - local extra = extraconf[rpathdir] - if extra and extra.installonly then - rpath_utils.insert(targetfile, rpathdir, {plat = target:plat(), arch = target:arch()}) - else - rpath_utils.remove(targetfile, rpathdir, {plat = target:plat(), arch = target:arch()}) - end + for _, rpathdir in ipairs(rpathdirs) do + local extra = extraconf and extraconf[rpathdir] or nil + if extra and extra.installonly then + rpath_utils.insert(targetfile, rpathdir, {plat = target:plat(), arch = target:arch()}) + else + rpath_utils.remove(targetfile, rpathdir, {plat = target:plat(), arch = target:arch()}) end end end -- cgit v1.3.1