summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-08-23 08:13:55 +0800
committerGitHub <[email protected]>2024-08-23 08:13:55 +0800
commit57df37f3d8e15a74cf9148471ba0cf6d13a11c53 (patch)
tree0f8b921513c46378231a5d79dbf0b50c64057985
parent7f4a28767f1a2e9a9139a58e176c5032d157f032 (diff)
parentf3298528cc2d3ae288c8df26bd14aa0b670ef316 (diff)
Merge pull request #5498 from xmake-io/rpath
fix rpath for #pull/5466
-rw-r--r--xmake/modules/target/action/install/main.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/xmake/modules/target/action/install/main.lua b/xmake/modules/target/action/install/main.lua
index 6eecfaba4..257bdcedc 100644
--- a/xmake/modules/target/action/install/main.lua
+++ b/xmake/modules/target/action/install/main.lua
@@ -158,18 +158,17 @@ function _update_install_rpath(target, opt)
local bindir = target:bindir()
local targetfile = path.join(bindir, target:filename())
if target:policy("install.rpath") then
- rpath_utils.clean(targetfile, {plat = target:plat(), arch = target:arch()})
local result, sources = target:get_from("rpathdirs", "*")
if result and sources then
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()})
- 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