summaryrefslogtreecommitdiff
path: root/xmake/modules/utils/binary/rpath.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-27 00:46:32 +0800
committerruki <[email protected]>2024-07-27 00:46:32 +0800
commit868cd13988f476e7a40f7282407a53e9e4e2b602 (patch)
tree5126b616e04cb59dbc81ea510fc20ab71c752867 /xmake/modules/utils/binary/rpath.lua
parent4599d8819789f0bae877302efccf24528f6c082d (diff)
add rpath warnings
Diffstat (limited to 'xmake/modules/utils/binary/rpath.lua')
-rw-r--r--xmake/modules/utils/binary/rpath.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmake/modules/utils/binary/rpath.lua b/xmake/modules/utils/binary/rpath.lua
index 7af3f679e..fcecb2b06 100644
--- a/xmake/modules/utils/binary/rpath.lua
+++ b/xmake/modules/utils/binary/rpath.lua
@@ -319,11 +319,16 @@ function insert(binaryfile, rpath, opt)
table.insert(ops, 1, _insert_rpath_by_install_name_tool)
end
rpath = _replace_rpath_vars(rpath, opt)
+ local done = false
for _, op in ipairs(ops) do
if op(binaryfile, rpath, opt) then
+ done = true
break
end
end
+ if not done then
+ wprint("cannot insert rpath to %s, no rpath utility available, maybe we need to install patchelf", binaryfile)
+ end
end
-- remove rpath
@@ -360,11 +365,16 @@ function change(binaryfile, rpath_old, rpath_new, opt)
end
rpath_old = _replace_rpath_vars(rpath_old, opt)
rpath_new = _replace_rpath_vars(rpath_new, opt)
+ local done = false
for _, op in ipairs(ops) do
if op(binaryfile, rpath_old, rpath_new, opt) then
+ done = true
break
end
end
+ if not done then
+ wprint("cannot change rpath to %s, no rpath utility available, maybe we need to install patchelf", binaryfile)
+ end
end
-- clean rpath
@@ -381,9 +391,14 @@ function clean(binaryfile, opt)
_clean_rpath_by_patchelf,
_clean_rpath_by_generic
}
+ local done = false
for _, op in ipairs(ops) do
if op(binaryfile, opt) then
+ done = true
break
end
end
+ if not done then
+ wprint("cannot clean rpath %s, no rpath utility available, maybe we need to install patchelf", binaryfile)
+ end
end