diff options
| author | ruki <[email protected]> | 2021-11-10 23:05:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-11-10 23:05:38 +0800 |
| commit | bc404bc6481de0c934aa5ff4523924688b72a2d4 (patch) | |
| tree | 13d21c0ca6bd6881ae110809e815d37665c4fd88 /xmake/rules/utils | |
| parent | b6ed301feb4b223a8c0faa9dd979a722b6e04555 (diff) | |
fix rpath for rust
Diffstat (limited to 'xmake/rules/utils')
| -rw-r--r-- | xmake/rules/utils/inherit_links/inherit_links.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/xmake/rules/utils/inherit_links/inherit_links.lua b/xmake/rules/utils/inherit_links/inherit_links.lua index d5567b605..805f535d8 100644 --- a/xmake/rules/utils/inherit_links/inherit_links.lua +++ b/xmake/rules/utils/inherit_links/inherit_links.lua @@ -46,7 +46,6 @@ function _add_export_value(target, name, value) end end --- main entry function main(target) -- disable inherit.links for `add_deps()`? @@ -59,12 +58,15 @@ function main(target) if targetkind == "shared" or targetkind == "static" then local targetfile = target:targetfile() - -- we need move target link to head - _add_export_value(target, "links", target:linkname()) - local links = target:get("links", {rawref = true}) - if links and type(links) == "table" and #links > 1 then - table.insert(links, 1, links[#links]) - table.remove(links, #links) + -- rust maybe will disable inherit links, only inherit linkdirs + if target:data("inherit.links.deplink") ~= false then + -- we need move target link to head + _add_export_value(target, "links", target:linkname()) + local links = target:get("links", {rawref = true}) + if links and type(links) == "table" and #links > 1 then + table.insert(links, 1, links[#links]) + table.remove(links, #links) + end end _add_export_value(target, "linkdirs", path.directory(targetfile)) |
