summaryrefslogtreecommitdiff
path: root/xmake/core/base/interpreter.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-27 09:52:52 +0800
committerruki <[email protected]>2017-07-27 09:52:52 +0800
commit84defbee206dd2d810070bfae7b7e269a3445896 (patch)
treee03f04e287b29689f570d308efd057230f355f16 /xmake/core/base/interpreter.lua
parentcb26be417ab85228b8dcbbb11bda655eb714e07e (diff)
add set_config_header instead of set_config_h and set_config_h_prefix
Diffstat (limited to 'xmake/core/base/interpreter.lua')
-rw-r--r--xmake/core/base/interpreter.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua
index 49592e082..5577b2a9a 100644
--- a/xmake/core/base/interpreter.lua
+++ b/xmake/core/base/interpreter.lua
@@ -333,15 +333,17 @@ function interpreter:_api_translate_pathes(...)
local curdir = path.directory(curfile)
assert(curdir)
- -- get all pathes
- local pathes = table.join(...)
-
-- translate the relative path
local results = {}
- for _, p in ipairs(pathes) do
- if not p:find("^%s-%$%(.-%)") and not path.is_absolute(p) then
- table.insert(results, path.relative(path.absolute(p, curdir), self._PRIVATE._ROOTDIR))
+ for _, p in ipairs({...}) do
+ if type(p) == "string" then
+ if not p:find("^%s-%$%(.-%)") and not path.is_absolute(p) then
+ table.insert(results, path.relative(path.absolute(p, curdir), self._PRIVATE._ROOTDIR))
+ else
+ table.insert(results, p)
+ end
else
+ -- @note do not translate non-string value, .e.g set_xxx("/xx/xx/xx", {arg = ""})
table.insert(results, p)
end
end
@@ -1092,7 +1094,6 @@ function interpreter:api_register_add_values(scope_kind, ...)
-- append values?
scope[name] = scope[name] or {}
table.join2(scope[name], ...)
-
end
-- register implementation
@@ -1111,7 +1112,6 @@ function interpreter:api_register_set_array(scope_kind, ...)
-- update array?
scope[name] = {}
table.insert(scope[name], {...})
-
end
-- register implementation