summaryrefslogtreecommitdiff
path: root/xmake/core/base/scopeinfo.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/base/scopeinfo.lua')
-rw-r--r--xmake/core/base/scopeinfo.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/xmake/core/base/scopeinfo.lua b/xmake/core/base/scopeinfo.lua
index 8254ffc98..0ca401237 100644
--- a/xmake/core/base/scopeinfo.lua
+++ b/xmake/core/base/scopeinfo.lua
@@ -210,10 +210,11 @@ function _instance:_api_set_groups(name, ...)
scope[name] = values
-- save extra config
- if extra_config and extra_config.name then
+ if extra_config then
scope["__extra_" .. name] = scope["__extra_" .. name] or {}
local extrascope = scope["__extra_" .. name]
- extrascope[extra_config.name] = extra_config
+ local key = table.concat(values, "_")
+ extrascope[key] = extra_config
end
end
@@ -241,10 +242,11 @@ function _instance:_api_add_groups(name, ...)
scope[name] = self:_api_handle(name, scope[name])
-- save extra config
- if extra_config and extra_config.name then
+ if extra_config then
scope["__extra_" .. name] = scope["__extra_" .. name] or {}
local extrascope = scope["__extra_" .. name]
- extrascope[extra_config.name] = extra_config
+ local key = table.concat(values, "_")
+ extrascope[key] = extra_config
end
end
@@ -690,6 +692,9 @@ function _instance:extraconf(name, item, key)
local value = extraconf
if item then
value = extraconf and extraconf[item] or nil
+ if value == nil and extraconf and type(item) == "table" then
+ value = extraconf[table.concat(item, "_")]
+ end
if value and key then
value = value[key]
end