summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-12-13 21:04:31 +0800
committerruki <[email protected]>2022-12-13 21:04:31 +0800
commita8b0c74065f49c2720776f2d7bb65c4e3b4c3ef9 (patch)
tree38ea25619303f30fcba6357aa569fca5cf5b01ea /xmake/core/project/target.lua
parent06876b8b33ae91a5dd12f8b94b295f3546885c8a (diff)
add default componments
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 2b38e4245..5e70431e9 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -416,9 +416,10 @@ function _instance:get_from_pkgs(name, opt)
local configinfo = self:pkgconfig(pkg:name())
-- get values from package components
-- e.g. `add_packages("sfml", {components = {"graphics", "window"}})`
- if configinfo and configinfo.components and pkg:components() then
+ local components_default = pkg:components_default()
+ if configinfo and (configinfo.components or components_default) and pkg:components() then
local components_enabled = hashset.new()
- for _, comp in ipairs(table.wrap(configinfo.components)) do
+ for _, comp in ipairs(table.join(configinfo.components or {}, components_default)) do
components_enabled:insert(comp)
for _, dep in ipairs(table.wrap(pkg:component_orderdeps(comp))) do
components_enabled:insert(dep)