diff options
| author | ruki <[email protected]> | 2020-04-17 22:31:07 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-04-17 09:06:47 +0800 |
| commit | 0e2c090e9205bc2f9fefe2bf150b7d38f47e04a3 (patch) | |
| tree | 2f3495332c0f76019a379f8413ed729961c76c11 | |
| parent | adbca27cb8ad58dfb2dd04b9c42ca876ea794be0 (diff) | |
fix inherit links
| -rw-r--r-- | xmake/rules/utils/inherit_links/inherit_links.lua | 12 |
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 |
