From b17daa462dd75c5a218a788698f30955d13ebe5f Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 20 Oct 2022 00:36:02 +0800 Subject: improve to get value from packages --- xmake/core/project/target.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.3.1