summaryrefslogtreecommitdiff
path: root/xmake/core/base/interpreter.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-05-14 23:02:01 +0800
committerruki <[email protected]>2020-05-14 12:12:09 +0800
commitc2e533cef2040461bb77a64349d28db924d4150b (patch)
treeb1fb0622cd61514be099ec30c3f282c1b3f169e4 /xmake/core/base/interpreter.lua
parentf7ece67bf3f768f98b22818aa13afd65a00831d7 (diff)
check flags policy
Diffstat (limited to 'xmake/core/base/interpreter.lua')
-rw-r--r--xmake/core/base/interpreter.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua
index fe56aa44a..1c301e891 100644
--- a/xmake/core/base/interpreter.lua
+++ b/xmake/core/base/interpreter.lua
@@ -490,7 +490,7 @@ function interpreter:_handle(scope, remove_repeat, enable_filter)
-- remove repeat first for each slice with deleted item (__del_xxx)
if remove_repeat and not table.is_dictionary(values) then
- values = table.unique(values, function (v) return v:startswith("__del_") end)
+ values = table.unique(values, function (v) return type(v) == "string" and v:startswith("__del_") end)
end
-- filter values
@@ -1118,6 +1118,9 @@ function interpreter:api_register_set_keyvalues(scope_kind, ...)
extra_config = nil
end
+ -- expand values if only one
+ values = table.unwrap(values)
+
-- save values to "name"
scope[name] = scope[name] or {}
scope[name][key] = values
@@ -1162,9 +1165,12 @@ function interpreter:api_register_add_keyvalues(scope_kind, ...)
extra_config = nil
end
+ -- expand values if only one
+ values = table.unwrap(values)
+
-- save values to "name"
scope[name] = scope[name] or {}
- scope[name][key] = table.join2(scope[name][key] or {}, values)
+ scope[name][key] = table.join2(table.wrap(scope[name][key]), values)
-- save values to "name.key"
local name_key = name .. "." .. key