summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/vsxmake/getinfo.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-17 16:36:12 +0800
committerOpportunityLiu <[email protected]>2019-07-19 11:48:32 +0800
commit482dfde9fd5cfa7ca02d70d76baf4b3a25f1d2b1 (patch)
tree2e7009c6149d2fec6141b1b7db8b95cfd2d161b6 /xmake/plugins/project/vsxmake/getinfo.lua
parent8a976c88c7b9da0a306fbbeac22870a7b00b4682 (diff)
add values from opts and packages
Diffstat (limited to 'xmake/plugins/project/vsxmake/getinfo.lua')
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua23
1 files changed, 22 insertions, 1 deletions
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 1f9760f1a..205e0ac4b 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -97,13 +97,34 @@ end
function _get_values(target, name)
local values = table.wrap(target:get(name))
+
+ -- from deps
for _, dep in irpairs(target:orderdeps()) do
local depinherit = target:extraconf("deps", dep:name(), "inherit")
if depinherit == nil or depinherit then
table.join2(values, dep:get(name, {interface = true}))
end
end
- return values
+
+ -- from opts
+ for _, opt in ipairs(target:orderopts()) do
+ table.join2(values, table.wrap(opt:get(name)))
+ end
+
+ -- from packages
+ for _, pkg in ipairs(target:orderpkgs()) do
+ -- uses them instead of the builtin configs if exists extra package config
+ -- e.g. `add_packages("xxx", {links = "xxx"})`
+ local configinfo = target:pkgconfig(pkg:name())
+ if configinfo and configinfo[name] then
+ table.join2(values, configinfo[name])
+ else
+ -- uses the builtin package configs
+ table.join2(values, pkg:get(name))
+ end
+ end
+
+ return table.unique(values)
end
-- make target info