diff options
| -rw-r--r-- | xmake/modules/private/platform/check_vstudio.lua | 14 | ||||
| -rw-r--r-- | xmake/platforms/windows/global.lua | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/xmake/modules/private/platform/check_vstudio.lua b/xmake/modules/private/platform/check_vstudio.lua index 6f4e8bab8..6657e43ea 100644 --- a/xmake/modules/private/platform/check_vstudio.lua +++ b/xmake/modules/private/platform/check_vstudio.lua @@ -76,8 +76,8 @@ function _check_vsenv(config) end end --- check the visual stdio -function main(config) +-- check the visual studio +function main(config, opt) -- attempt to check the given vs version first local vs = _check_vsenv(config) @@ -91,10 +91,12 @@ function main(config) else -- failed cprint("checking for the Microsoft Visual Studio (%s) version ... ${color.nothing}${text.nothing}", config.get("arch")) - print("please run:") - print(" - xmake config --vs=xxx [--vs_toolset=xxx]") - print("or - xmake global --vs=xxx") - raise() + if not (opt and opt.try) then + print("please run:") + print(" - xmake config --vs=xxx [--vs_toolset=xxx]") + print("or - xmake global --vs=xxx") + raise() + end end end diff --git a/xmake/platforms/windows/global.lua b/xmake/platforms/windows/global.lua index f4c47894b..9ef580bef 100644 --- a/xmake/platforms/windows/global.lua +++ b/xmake/platforms/windows/global.lua @@ -41,7 +41,7 @@ function main(platform, name) check_arch(global) -- check vstudio - check_vstudio(global) + check_vstudio(global, {try = true}) -- clean temporary global configs _clean_global() |
