summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-10-20 00:36:02 +0800
committerruki <[email protected]>2022-10-20 00:36:02 +0800
commitb17daa462dd75c5a218a788698f30955d13ebe5f (patch)
tree955e0558e12b0149f8573adc8ffc39ee19a1dabd
parent56302de4dff5414efec3cf3216d639ed7ab20b1f (diff)
improve to get value from packages
-rw-r--r--xmake/core/project/target.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 7eb0a2d94..7cd18e984 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -417,7 +417,7 @@ 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 then
+ if configinfo and configinfo.components and pkg:components() then
local components_enabled = hashset.new()
for _, comp in ipairs(table.wrap(configinfo.components)) do
components_enabled:insert(comp)