summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-03-04 00:37:20 +0800
committerruki <[email protected]>2020-03-03 21:44:02 +0800
commit09c073b1f36aaad61dccd02dafe2a4097ffbee67 (patch)
treef553167fc4457476c9bdf3cd0c077c1106b0103a
parent35fd0056a576861e1e26d21fd7ffe8a8682d7c61 (diff)
fix global config
-rw-r--r--xmake/modules/private/platform/check_vstudio.lua14
-rw-r--r--xmake/platforms/windows/global.lua2
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()