summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-07 22:54:43 +0800
committerruki <[email protected]>2020-04-07 11:28:23 +0800
commit1e491924ccad666ad42e30d30e2031662bc1d3d0 (patch)
tree1b631e8dc02b63c71fd6fb049fc33c7f3e328cf1
parent67ef2f1cc411ead96ca4ca8c537ea0d780482cd9 (diff)
fix inherit_links rule
-rw-r--r--xmake/rules/utils/inherit_links/inherit_links.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/rules/utils/inherit_links/inherit_links.lua b/xmake/rules/utils/inherit_links/inherit_links.lua
index d1f20c2d2..d31d3eb14 100644
--- a/xmake/rules/utils/inherit_links/inherit_links.lua
+++ b/xmake/rules/utils/inherit_links/inherit_links.lua
@@ -58,8 +58,8 @@ function main(target)
-- export links and linkdirs
local targetkind = target:targetkind()
- local targetfile = target:targetfile()
if targetkind == "shared" or targetkind == "static" then
+ local targetfile = target:targetfile()
target:add("links", target:basename(), {interface = true})
target:add("linkdirs", path.directory(targetfile), {interface = true})
for _, name in ipairs({"frameworkdirs", "frameworks", "linkdirs", "links", "syslinks"}) do
@@ -72,9 +72,10 @@ function main(target)
-- export rpathdirs for all shared library
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()), path.directory(targetfile))
+ local subdir = path.relative(path.directory(dep:targetfile()), targetdir)
if subdir and subdir ~= '.' then
rpathdir = path.join(rpathdir, subdir)
end