diff options
| author | ruki <[email protected]> | 2021-02-26 00:00:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-26 00:00:24 +0800 |
| commit | 4e751bd2feb3c29fb51fedc4d81c4e7db6e4b9ac (patch) | |
| tree | 9d05218838cfc30cfab37c85e9f688f064c5999d /xmake/rules/utils | |
| parent | 017aea4a93318a09e0137190ae72302b8257d3b1 (diff) | |
improve to export links
Diffstat (limited to 'xmake/rules/utils')
| -rw-r--r-- | xmake/rules/utils/inherit_links/inherit_links.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/xmake/rules/utils/inherit_links/inherit_links.lua b/xmake/rules/utils/inherit_links/inherit_links.lua index 65e8bdce1..2a130aac0 100644 --- a/xmake/rules/utils/inherit_links/inherit_links.lua +++ b/xmake/rules/utils/inherit_links/inherit_links.lua @@ -53,10 +53,16 @@ function main(target) end -- we export all links and linkdirs in self/packages/options to the parent target by default - for _, name in ipairs({"frameworkdirs", "frameworks", "linkdirs", "links", "syslinks"}) do - local values = _get_values_from_target(target, name) - if values and #values > 0 then - target:add(name, values, {public = true}) + -- + -- @note we only export links for static target, + -- and we need pass `{public = true}` to add_packages/add_links/... to export it if want to export links for shared target + -- + if targetkind == "static" then + for _, name in ipairs({"frameworkdirs", "frameworks", "linkdirs", "links", "syslinks"}) do + local values = _get_values_from_target(target, name) + if values and #values > 0 then + target:add(name, values, {public = true}) + end end end end |
