diff options
| author | ruki <[email protected]> | 2016-01-21 23:01:42 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-02-15 19:10:25 +0800 |
| commit | 7aac238641926dfc0386e8be78958a63e0866c19 (patch) | |
| tree | 5a63d9f79afec32692682837fe47060187e10281 | |
| parent | 0384d6aee3e0a5c1f86c8d60638d8228acb53601 (diff) | |
fix interpreter and project bug
| -rw-r--r-- | xmake/core/base/interpreter.lua | 20 | ||||
| -rw-r--r-- | xmake/core/base/project.lua | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index 4de222be5..016e69954 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -505,17 +505,17 @@ function interpreter.api_register_set_scope(self, ...) -- define implementation local implementation = function (self, scopes, scope_kind, scope_name) + -- init scope for kind + local scope_for_kind = scopes[scope_kind] or {} + scopes[scope_kind] = scope_for_kind + -- check - if not scopes[scope_kind] then + if not scope_for_kind[scope_name] then utils.error("set_%s(\"%s\") failed, %s not found!", scope_kind, scope_name, scope_name) utils.error("please uses add_%s(\"%s\") first!", scope_kind, scope_name) utils.abort() end - -- init scope for kind - local scope_for_kind = scopes[scope_kind] or {} - scopes[scope_kind] = scope_for_kind - -- init scope for name scope_for_kind[scope_name] = scope_for_kind[scope_name] or {} @@ -537,17 +537,17 @@ function interpreter.api_register_add_scope(self, ...) -- define implementation local implementation = function (self, scopes, scope_kind, scope_name) + -- init scope for kind + local scope_for_kind = scopes[scope_kind] or {} + scopes[scope_kind] = scope_for_kind + -- check - if scopes[scope_kind] then + if scope_for_kind[scope_name] then utils.error("add_%s(\"%s\") failed, %s have been defined!", scope_kind, scope_name, scope_name) utils.error("please uses set_%s(\"%s\")!", scope_kind, scope_name) utils.abort() end - -- init scope for kind - local scope_for_kind = scopes[scope_kind] or {} - scopes[scope_kind] = scope_for_kind - -- init scope for name scope_for_kind[scope_name] = scope_for_kind[scope_name] or {} diff --git a/xmake/core/base/project.lua b/xmake/core/base/project.lua index b07d11631..d0d9cb4c8 100644 --- a/xmake/core/base/project.lua +++ b/xmake/core/base/project.lua @@ -1030,7 +1030,7 @@ function project.menu() -- the default value local default = "auto" if opt.enable ~= nil then - default = utils.unwrap(opt.enable) + default = opt.enable end -- is first? @@ -1045,7 +1045,7 @@ function project.menu() -- append it if opt.description then - table.insert(menu, {nil, name, "kv", default, utils.unwrap(opt.description)}) + table.insert(menu, {nil, name, "kv", default, opt.description}) else table.insert(menu, {nil, name, "kv", default, nil}) end |
