diff options
Diffstat (limited to 'msvc/scripts/tests/setup-toolchain.bat')
-rw-r--r-- | msvc/scripts/tests/setup-toolchain.bat | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/msvc/scripts/tests/setup-toolchain.bat b/msvc/scripts/tests/setup-toolchain.bat index d5dd6e61402..422119d2104 100644 --- a/msvc/scripts/tests/setup-toolchain.bat +++ b/msvc/scripts/tests/setup-toolchain.bat @@ -4,7 +4,7 @@ REM Look for Mono toolchain. ECHO Searching for Mono toolchain... IF NOT EXIST "%MONO_CROSS_COMPILER_HOME%\mono-sgen.exe" ( ECHO Could not find "%MONO_CROSS_COMPILER_HOME%\mono-sgen.exe". - EXIT /b 1 + GOTO ON_ERROR ) ECHO Found "%MONO_CROSS_COMPILER_HOME%\mono-sgen.exe". @@ -19,22 +19,37 @@ SET MONO_LLVM_EXECUTABLES=%MONO_DIST_DIR%\llvm\bin REM Setup toolchain. IF "%VisualStudioVersion%" == "14.0" ( - CALL %SCRIPT_DIR%clang-vs2015-toolchain.bat -) ELSE ( - IF "%VisualStudioVersion%" == "15.0" ( - CALL %SCRIPT_DIR%clang-vs2017-toolchain.bat - ) ELSE ( - ECHO Failed to identify supported Visual Studio toolchain. Environment variable VisualStudioVersion must be set to 14.0 for VS2015 or 15.0 for VS2017. Checking supported toolchains for more error diagnostics... - CALL %SCRIPT_DIR%clang-vs2015-toolchain.bat - CALL %SCRIPT_DIR%clang-vs2017-toolchain.bat - EXIT /b 1 + CALL %SCRIPT_DIR%clang-vs2015-toolchain.bat || ( + GOTO ON_ERROR ) + GOTO SETUP_PATH ) -IF NOT ERRORLEVEL == 0 ( - EXIT /b %ERRORLEVEL% +IF "%VisualStudioVersion%" == "15.0" ( + CALL %SCRIPT_DIR%clang-vs2017-toolchain.bat || ( + GOTO ON_ERROR + ) + GOTO SETUP_PATH +) + +IF "%VisualStudioVersion%" == "16.0" ( + CALL %SCRIPT_DIR%clang-vs2019-toolchain.bat || ( + GOTO ON_ERROR + ) + GOTO SETUP_PATH ) +ECHO Failed to identify supported Visual Studio toolchain. Environment variable VisualStudioVersion must be set to 14.0 for VS2015, 15.0 for VS2017 or 16.0 for VS2019. Checking supported toolchains for more error diagnostics... +GOTO ON_ERROR + +:SETUP_PATH + SET PATH=%MONO_JIT_EXECUTABLE_PATH%;%MONO_AOT_RUNTIME_PATH%;%MONO_AOT_COMPILER_PATH%;%MONO_LLVM_EXECUTABLES%;%PATH% -EXIT /b 0
\ No newline at end of file +GOTO ON_EXIT + +:ON_ERROR + EXIT /b 1 + +:ON_EXIT + EXIT /b 0 |