Skip to content

Commit 57df37f

Browse files
authored
Merge pull request #5498 from xmake-io/rpath
fix rpath for #pull/5466
2 parents 7f4a287 + f329852 commit 57df37f

File tree

1 file changed

+6
-7
lines changed
  • xmake/modules/target/action/install

1 file changed

+6
-7
lines changed

xmake/modules/target/action/install/main.lua

+6-7
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,17 @@ function _update_install_rpath(target, opt)
158158
local bindir = target:bindir()
159159
local targetfile = path.join(bindir, target:filename())
160160
if target:policy("install.rpath") then
161-
rpath_utils.clean(targetfile, {plat = target:plat(), arch = target:arch()})
162161
local result, sources = target:get_from("rpathdirs", "*")
163162
if result and sources then
164163
for idx, rpathdirs in ipairs(result) do
165164
local source = sources[idx]
166165
local extraconf = target:extraconf_from("rpathdirs", source)
167-
if extraconf then
168-
for _, rpathdir in ipairs(rpathdirs) do
169-
local extra = extraconf[rpathdir]
170-
if extra and extra.installonly then
171-
rpath_utils.insert(targetfile, rpathdir, {plat = target:plat(), arch = target:arch()})
172-
end
166+
for _, rpathdir in ipairs(rpathdirs) do
167+
local extra = extraconf and extraconf[rpathdir] or nil
168+
if extra and extra.installonly then
169+
rpath_utils.insert(targetfile, rpathdir, {plat = target:plat(), arch = target:arch()})
170+
else
171+
rpath_utils.remove(targetfile, rpathdir, {plat = target:plat(), arch = target:arch()})
173172
end
174173
end
175174
end

0 commit comments

Comments
 (0)