summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)