summaryrefslogtreecommitdiff
path: root/xmake/rules/utils
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-17 22:31:07 +0800
committerruki <[email protected]>2020-04-17 09:06:47 +0800
commit0e2c090e9205bc2f9fefe2bf150b7d38f47e04a3 (patch)
tree2f3495332c0f76019a379f8413ed729961c76c11 /xmake/rules/utils
parentadbca27cb8ad58dfb2dd04b9c42ca876ea794be0 (diff)
fix inherit links
Diffstat (limited to 'xmake/rules/utils')
-rw-r--r--xmake/rules/utils/inherit_links/inherit_links.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/xmake/rules/utils/inherit_links/inherit_links.lua b/xmake/rules/utils/inherit_links/inherit_links.lua
index 20b6e3000..a810df2e4 100644
--- a/xmake/rules/utils/inherit_links/inherit_links.lua
+++ b/xmake/rules/utils/inherit_links/inherit_links.lua
@@ -74,12 +74,14 @@ function main(target)
if targetkind == "binary" then
local targetdir = target:targetdir()
for _, dep in ipairs(target:orderdeps()) do
- local rpathdir = "@loader_path"
- local subdir = path.relative(path.directory(dep:targetfile()), targetdir)
- if subdir and subdir ~= '.' then
- rpathdir = path.join(rpathdir, subdir)
+ if dep:targetkind() == "shared" then
+ local rpathdir = "@loader_path"
+ local subdir = path.relative(path.directory(dep:targetfile()), targetdir)
+ if subdir and subdir ~= '.' then
+ rpathdir = path.join(rpathdir, subdir)
+ end
+ target:add("rpathdirs", rpathdir)
end
- target:add("rpathdirs", rpathdir)
end
end
end