1 :: Set up build environment and run execute msbuild with all supplied arguments.
\r
7 set VS_2015_DEV_CMD=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\Tools\VsMSBuildCmd.bat
\r
8 set VS_2015_BUILD_TOOLS_CMD=%ProgramFiles(x86)%\Microsoft Visual C++ Build Tools\vcbuildtools_msbuild.bat
\r
9 set VSWHERE_TOOLS_BIN=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe
\r
10 set VS_2017_DEV_CMD=
\r
11 set VS_2017_BUILD_TOOLS_CMD=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsMSBuildCmd.bat
\r
12 set VS_PLATFORM_TOOLSET=/p:PlatformToolset=v140
\r
14 :: Visual Studio 2015 == 14.0
\r
15 :: Visual Studio 2017 == 15.0
\r
16 if "%VisualStudioVersion%" == "15.0" (
\r
22 if exist "%VS_2015_DEV_CMD%" (
\r
23 echo Setting up VS2015 build environment.
\r
24 call "%VS_2015_DEV_CMD%" && (
\r
29 if exist "%VS_2015_BUILD_TOOLS_CMD%" (
\r
30 echo Setting up VS2015 build environment.
\r
31 call "%VS_2015_BUILD_TOOLS_CMD%" && (
\r
38 if exist "%VSWHERE_TOOLS_BIN%" (
\r
39 for /f "tokens=*" %%a in ('"%VSWHERE_TOOLS_BIN%" -latest -property installationPath') do (
\r
40 set VS_2017_DEV_CMD=%%a\Common7\Tools\VsMSBuildCmd.bat
\r
44 if exist "%VS_2017_DEV_CMD%" (
\r
45 echo Setting up VS2017 build environment.
\r
46 call "%VS_2017_DEV_CMD%"
\r
47 set VS_PLATFORM_TOOLSET=/p:PlatformToolset=v141
\r
50 if exist "%VS_2017_BUILD_TOOLS_CMD%" (
\r
51 echo Setting up VS2017 build environment.
\r
52 call "%VS_2017_BUILD_TOOLS_CMD%"
\r
53 set VS_PLATFORM_TOOLSET=/p:PlatformToolset=v141
\r
58 call msbuild.exe %VS_PLATFORM_TOOLSET% %* "%~dp0mono.sln" && (
\r
62 exit /b %BUILD_RESULT%
\r