summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-05-12 09:47:58 +0800
committerruki <[email protected]>2015-05-12 09:47:58 +0800
commitfc66b05d2d238830106890447db7ed3808375de1 (patch)
tree68a1947e2a98e59a3d6b1f0b056551d4be076cde /xmake/scripts/base/main.lua
parent7a187d3be10e1aeced3b1cc84a1d3b458ecfc53d (diff)
merge defaults to configs
Diffstat (limited to 'xmake/scripts/base/main.lua')
-rw-r--r--xmake/scripts/base/main.lua19
1 files changed, 11 insertions, 8 deletions
diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua
index ff4ddfaac..9a032f5a8 100644
--- a/xmake/scripts/base/main.lua
+++ b/xmake/scripts/base/main.lua
@@ -141,9 +141,10 @@ local menu =
{
{'p', "plat", "kv", "auto", "Compile for the given platform." }
, {'a', "arch", "kv", "auto", "Compile for the given architecture." }
- , {'d', "debug", "k", nil, "Compile for the debugging mode." }
- , {'s', "small", "k", nil, "Compile for the small mode." }
- , {nil, "profile", "k", nil, "Compile for the profiling mode and disable the debugging mode."}
+ , {'m', "mode", "kv", "release", "Compile for the given mode."
+ , " - debug"
+ , " - release"
+ , " - profile" }
, {}
, {'o', "output", "kv", "build", "Set the build directory" }
@@ -277,20 +278,18 @@ function main._done_option()
assert(options.file)
-- load and execute the xmake.lua script of the given project
+ local errors = nil
local script = loadfile(options.file)
if script then
-- execute it
local ok, err = pcall(script)
if not ok then
-- error
- utils.error("load %s failed!", options.file)
- utils.error(err)
- return false
+ errors = err
end
else
-- error
- utils.error("%s not found!", options.file)
- return false
+ errors = string.format("%s not found!", options.file)
end
-- done help
@@ -317,6 +316,10 @@ function main._done_option()
-- ok
return true
+ elseif errors then
+ -- error
+ utils.error(errors)
+ return false
end
-- done action