summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-23 23:02:52 +0800
committerruki <[email protected]>2020-10-23 23:02:52 +0800
commitd1ecb3c26a99386fee1319d4f4f14dff423cc617 (patch)
tree4a105f2b5a86c3b759f315353b079ecdbe01607e
parent0c4806f1d4f42c50774f60e9d276c57f6637f3a3 (diff)
add EHsc as default flags
-rw-r--r--xmake/modules/private/xrepo/main.lua9
-rw-r--r--xmake/toolchains/msvc/load.lua3
2 files changed, 10 insertions, 2 deletions
diff --git a/xmake/modules/private/xrepo/main.lua b/xmake/modules/private/xrepo/main.lua
index 6253ca6d5..c9b1299e8 100644
--- a/xmake/modules/private/xrepo/main.lua
+++ b/xmake/modules/private/xrepo/main.lua
@@ -120,6 +120,10 @@ function _parse_options(...)
local common_options =
{
{},
+ {'q', "quiet", "k", nil, "Quiet operation."},
+ {'y', "yes", "k", nil, "Input yes by default if need user confirm."},
+ {nil, "root", "k", nil, "Allow to run xrepo as root."},
+ {},
{'v', "verbose", "k", nil, "Print lots of verbose information for users."},
{'D', "diagnosis", "k", nil, "Print lots of diagnosis information."},
{nil, "version", "k", nil, "Print the version number and exit."},
@@ -168,8 +172,9 @@ function main(...)
-- init option
option.save()
- option.set("verbose", options.verbose)
- option.set("diagnosis", options.diagnosis)
+ for k, v in pairs(options) do
+ option.set(k, v)
+ end
-- do action
if menu.action then
diff --git a/xmake/toolchains/msvc/load.lua b/xmake/toolchains/msvc/load.lua
index 19e4c4e3a..3e6dd39d5 100644
--- a/xmake/toolchains/msvc/load.lua
+++ b/xmake/toolchains/msvc/load.lua
@@ -84,5 +84,8 @@ function main(toolchain)
_add_vsenv(toolchain, "LIB")
_add_vsenv(toolchain, "INCLUDE")
_add_vsenv(toolchain, "LIBPATH")
+
+ -- add some default flags
+ toolchain:add("cxxflags", "/EHsc")
end