diff options
| author | ruki <[email protected]> | 2020-12-04 00:36:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-12-04 00:36:19 +0800 |
| commit | 153ae307f21b27b00e1d9cfcf26b45749da35d9d (patch) | |
| tree | c79af1b40e644561fb7f48432c9c801976ef02e3 /xmake/rules/utils | |
| parent | 3a153263bb876ea1447cc8d747a76d5ba41d6047 (diff) | |
fix inherit links
Diffstat (limited to 'xmake/rules/utils')
| -rw-r--r-- | xmake/rules/utils/inherit_links/inherit_links.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/xmake/rules/utils/inherit_links/inherit_links.lua b/xmake/rules/utils/inherit_links/inherit_links.lua index 07fcb7d19..cb3be74a9 100644 --- a/xmake/rules/utils/inherit_links/inherit_links.lua +++ b/xmake/rules/utils/inherit_links/inherit_links.lua @@ -38,8 +38,15 @@ function main(target) local targetkind = target:targetkind() if targetkind == "shared" or targetkind == "static" then local targetfile = target:targetfile() - local links = target:get("links", {interface = true}) - target:set("links", table.join(target:basename(), links), {interface = true}) -- we need move target link to head + + -- we need move target link to head + target:add("links", target:basename(), {interface = true}) + 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 + target:add("linkdirs", path.directory(targetfile), {interface = true}) if target:rule("go") then -- we need add includedirs to support import modules for golang |
