diff options
| author | ruki <[email protected]> | 2015-05-21 10:10:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-05-21 10:10:24 +0800 |
| commit | 24e6b488718dab5dc58a7b4adc901884d716f478 (patch) | |
| tree | a3963cc0d8ee123de1fcaacf9354e996401b06c3 /xmake/scripts/base/main.lua | |
| parent | 111bd8e8cbf0c3b242ed3b137415d9560c4aac37 (diff) | |
list plats and archs for options
Diffstat (limited to 'xmake/scripts/base/main.lua')
| -rw-r--r-- | xmake/scripts/base/main.lua | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua index 97ec71b01..13ce70dfa 100644 --- a/xmake/scripts/base/main.lua +++ b/xmake/scripts/base/main.lua @@ -143,13 +143,39 @@ local menu = -- options , options = { - {'p', "plat", "kv", "auto", "Compile for the given platform." } - , {'a', "arch", "kv", "auto", "Compile for the given architecture." } + {'p', "plat", "kv", xmake._HOST, "Compile for the given platform." + , function () + local descriptions = {} + local plats = platform.plats() + if plats then + for i, plat in ipairs(plats) do + descriptions[i] = " - " .. plat + end + end + return descriptions + end } + , {'a', "arch", "kv", xmake._ARCH, "Compile for the given architecture." + , function () + local descriptions = {} + local plats = platform.plats() + if plats then + for i, plat in ipairs(plats) do + descriptions[i] = " - " .. plat .. ":" + local archs = platform.archs(plat) + if archs then + for _, arch in ipairs(archs) do + descriptions[i] = descriptions[i] .. " " .. arch + end + end + end + end + return descriptions + end } , {'m', "mode", "kv", "release", "Compile for the given mode." , " - debug" , " - release" , " - profile" } - , {'-', "host", "kv", "auto", "The current host environment." } + , {'-', "host", "kv", xmake._HOST, "The current host environment." } , {} , {'o', "buildir", "kv", "build", "Set the build directory" } |
