diff options
| -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 |
