summaryrefslogtreecommitdiff
path: root/xmake/core/project
diff options
context:
space:
mode:
authorruki <[email protected]>2022-10-19 22:37:25 +0800
committerruki <[email protected]>2022-10-19 22:37:25 +0800
commitb72444bdd60a6ce90cd899743b0b304dc3159f11 (patch)
tree7e589ff3da7b9aa8692290d8fb2b3796f419886f /xmake/core/project
parentf55de1eb50c29fc58bbaef1bc387035a8deabe6e (diff)
use private components
Diffstat (limited to 'xmake/core/project')
-rw-r--r--xmake/core/project/package.lua6
-rw-r--r--xmake/core/project/target.lua2
2 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/project/package.lua b/xmake/core/project/package.lua
index d1464fa4d..af372455b 100644
--- a/xmake/core/project/package.lua
+++ b/xmake/core/project/package.lua
@@ -125,9 +125,9 @@ function _instance:components_list()
return self:get("__components_list")
end
--- get default components
-function _instance:components_default()
- return self:get("__components_default")
+-- get private components
+function _instance:components_private()
+ return self:get("__components_private")
end
-- get the extra info from the given name
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 418ff31cc..28a63e9fa 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -419,7 +419,7 @@ function _instance:get_from_pkgs(name, opt)
-- e.g. `add_packages("sfml", {components = {"graphics", "window"}})`
if configinfo and configinfo.components then
local components_enabled = hashset.from(table.wrap(configinfo.components))
- for _, comp in ipairs(table.wrap(pkg:components_default())) do
+ for _, comp in ipairs(table.wrap(pkg:components_private())) do
components_enabled:insert(comp)
end
components_enabled:insert("__base")