From 60bd22effb5664fefafabe69f5023301b6970e7b Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 15 Jun 2015 22:48:05 +0800 Subject: fix run arguments bug --- xmake/scripts/action/_run.lua | 2 +- xmake/scripts/base/project.lua | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/xmake/scripts/action/_run.lua b/xmake/scripts/action/_run.lua index c2b46ad9b..1a24874e0 100644 --- a/xmake/scripts/action/_run.lua +++ b/xmake/scripts/action/_run.lua @@ -82,7 +82,7 @@ function _run.done() end -- done - local ok = os.execute(string.format("%s %s", targetfile, table.concat(arguments))) + local ok = os.execute(string.format("%s %s", targetfile, table.concat(arguments, " "))) -- ok? return utils.ifelse(ok == 0, true, false) diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua index 5e5318236..0d2c465b8 100644 --- a/xmake/scripts/base/project.lua +++ b/xmake/scripts/base/project.lua @@ -89,14 +89,15 @@ function project._api_archs(env, ...) end end --- enable option? -function project._api_option(env, name) +-- enable options? +function project._api_options(env, ...) - -- check - assert(name) - - -- enable? - return config.get(name) + -- some options are enabled? + for _, o in ipairs(table.join(...)) do + if o and type(o) == "string" and config.get(o) then + return true + end + end end -- add target @@ -791,7 +792,7 @@ function project._load_targets(file) newenv.modes = function (...) return project._api_modes(newenv, ...) end newenv.plats = function (...) return project._api_plats(newenv, ...) end newenv.archs = function (...) return project._api_archs(newenv, ...) end - newenv.option = function (...) return project._api_option(newenv, ...) end + newenv.options = function (...) return project._api_options(newenv, ...) end -- register interfaces for the target newenv.set_target = function (...) return project._api_add_target(newenv, ...) end -- cgit v1.3.1