summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/rules/utils/inherit_links/inherit_links.lua14
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