From 868cd13988f476e7a40f7282407a53e9e4e2b602 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 27 Jul 2024 00:46:32 +0800 Subject: add rpath warnings --- xmake/modules/utils/binary/rpath.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'xmake/modules/utils/binary/rpath.lua') 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 -- cgit v1.3.1