From 36d0a55600d687bb327966207e82f5c83cc6bc47 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Thu, 18 Jun 2020 14:50:07 +0100 Subject: [PATCH] Add error message when vswhere doesn't find MSVC --- CI/before_script.msvc.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh index b8570545b..79885255f 100644 --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -945,6 +945,11 @@ if [ -n "$ACTIVATE_MSVC" ]; then command -v vswhere >/dev/null 2>&1 || { echo "Error: vswhere is not on the path."; wrappedExit 1; } MSVC_INSTALLATION_PATH=$(vswhere -legacy -products '*' -version "[$MSVC_VER,$(awk "BEGIN { print $MSVC_REAL_VER + 1; exit }"))" -property installationPath) + if [ -z "$MSVC_INSTALLATION_PATH" ]; then + echo "vswhere was unable to find MSVC $MSVC_DISPLAY_YEAR" + wrappedExit 1 + fi + echo "@\"${MSVC_INSTALLATION_PATH}\Common7\Tools\VsDevCmd.bat\" -no_logo -arch=$([ $BITS -eq 64 ] && echo "amd64" || echo "x86") -host_arch=$([ $(uname -m) == 'x86_64' ] && echo "amd64" || echo "x86")" > ActivateMSVC.bat cp "../CI/activate_msvc.sh" .