From d1ecb3c26a99386fee1319d4f4f14dff423cc617 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 23 Oct 2020 23:02:52 +0800 Subject: add EHsc as default flags --- xmake/modules/private/xrepo/main.lua | 9 +++++++-- xmake/toolchains/msvc/load.lua | 3 +++ 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 @@ -119,6 +119,10 @@ function _parse_options(...) -- insert common 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."}, @@ -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 -- cgit v1.3.1