summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2022-10-19 22:36:19 +0800
committerruki <[email protected]>2022-10-19 22:36:19 +0800
commitf55de1eb50c29fc58bbaef1bc387035a8deabe6e (patch)
treebdc81e4eca0e93c5c5814c42d8468814106acf3f /xmake/modules
parent0d3dc74e78b1d93de70c1a5e053afc9099e89029 (diff)
support default components
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/private/action/require/impl/register_packages.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/register_packages.lua b/xmake/modules/private/action/require/impl/register_packages.lua
index 0ac1b833a..a6247cc9a 100644
--- a/xmake/modules/private/action/require/impl/register_packages.lua
+++ b/xmake/modules/private/action/require/impl/register_packages.lua
@@ -56,6 +56,20 @@ function _register_required_package_libs(instance, required_package, is_deps)
fetchinfo.components = nil
required_package:add(fetchinfo)
+ -- save components list
+ if components then
+ required_package:set("__components_list", instance:get("components"))
+ local components_default = {}
+ for _, comp in ipairs(instance:get("components")) do
+ if instance:extraconf("components", comp, "default") then
+ table.insert(components_default, comp)
+ end
+ end
+ if #components_default > 0 then
+ required_package:set("__components_default", components_default)
+ end
+ end
+
-- merge into the components values
local required_components = required_package:get("components")
if required_components then