summaryrefslogtreecommitdiff
path: root/xmake/modules/target
diff options
context:
space:
mode:
authorruki <[email protected]>2025-07-26 00:47:48 +0800
committerruki <[email protected]>2025-07-26 00:47:48 +0800
commite3759b8bd56d614b49d95256c04c7d093100d64a (patch)
treecb290dce757bfff2bb07377569c033665cae1c41 /xmake/modules/target
parent53d106bc017dc2e7db4bdff583ebe863c957ab9f (diff)
add resolve_hint_paths
Diffstat (limited to 'xmake/modules/target')
-rw-r--r--xmake/modules/target/action/install/main.lua10
-rw-r--r--xmake/modules/target/action/uninstall/main.lua11
2 files changed, 9 insertions, 12 deletions
diff --git a/xmake/modules/target/action/install/main.lua b/xmake/modules/target/action/install/main.lua
index 0d102ffd7..d9faa80ad 100644
--- a/xmake/modules/target/action/install/main.lua
+++ b/xmake/modules/target/action/install/main.lua
@@ -71,13 +71,11 @@ function _get_target_package_libfiles(target, opt)
-- we need to get all deplibs, e.g. app -> libfoo.so -> libbar.so ...
-- @see https://github.com/xmake-io/xmake/issues/5325#issuecomment-2242597732
local deplibs = get_depend_libraries(opt.binaryfile or target:targetfile(), {
- recursive = true, plat = target:plat(), arch = target:arch()})
+ plat = target:plat(), arch = target:arch(),
+ recursive = true, resolve_path = true, resolve_hint_paths = libfiles})
if deplibs then
- local depends = hashset.new()
- for _, deplib in ipairs(deplibs) do
- depends:insert(path.filename(deplib))
- end
- table.remove_if(libfiles, function (_, libfile) return not depends:has(path.filename(libfile)) end)
+ local depends = hashset.from(deplibs)
+ table.remove_if(libfiles, function (_, libfile) return not depends:has(libfile) end)
end
end
end
diff --git a/xmake/modules/target/action/uninstall/main.lua b/xmake/modules/target/action/uninstall/main.lua
index 6eff73529..2273ff76d 100644
--- a/xmake/modules/target/action/uninstall/main.lua
+++ b/xmake/modules/target/action/uninstall/main.lua
@@ -70,13 +70,12 @@ function _get_target_package_libfiles(target, opt)
if target:is_binary() or target:is_shared() or opt.binaryfile then
-- we need to get all deplibs, e.g. app -> libfoo.so -> libbar.so ...
-- @see https://github.com/xmake-io/xmake/issues/5325#issuecomment-2242597732
- local deplibs = get_depend_libraries(opt.binaryfile or target:targetfile(), {recursive = true, plat = target:plat(), arch = target:arch()})
+ local deplibs = get_depend_libraries(opt.binaryfile or target:targetfile(), {
+ plat = target:plat(), arch = target:arch(),
+ recursive = true, resolve_path = true, resolve_hint_paths = libfiles})
if deplibs then
- local depends = hashset.new()
- for _, deplib in ipairs(deplibs) do
- depends:insert(path.filename(deplib))
- end
- table.remove_if(libfiles, function (_, libfile) return not depends:has(path.filename(libfile)) end)
+ local depends = hashset.from(deplibs)
+ table.remove_if(libfiles, function (_, libfile) return not depends:has(libfile) end)
end
end
end