1 :: Set up build environment and run execute msbuild with all supplied arguments.
\r
4 :: -------------------------------------------------------
\r
5 :: %1 Visual Studio target, build|clean, default build
\r
6 :: %2 Host CPU architecture, x86_64|i686, default x86_64
\r
7 :: %3 Visual Studio configuration, debug|release, default release
\r
8 :: %4 Additional arguments passed to msbuild, needs to be quoted if multiple.
\r
9 :: -------------------------------------------------------
\r
16 :: Get path for current running script.
\r
17 set RUN_MSBUILD_SCRIPT_PATH=%~dp0
\r
19 :: Configure all known build arguments.
\r
20 set VS_BUILD_ARGS=""
\r
22 if /i "%~1" == "clean" (
\r
23 set VS_TARGET="clean"
\r
28 if /i "%~1" == "i686" (
\r
29 set VS_PLATFORM="Win32"
\r
31 if /i "%~1" == "win32" (
\r
32 set VS_PLATFORM="Win32"
\r
36 set VS_CONFIGURATION=Release
\r
37 if /i "%~1" == "debug" (
\r
38 set VS_CONFIGURATION="Debug"
\r
42 set "VS_ADDITIONAL_ARGUMENTS=/p:PlatformToolset=v140 /p:MONO_TARGET_GC=sgen"
\r
43 if /i not "%~1" == "" (
\r
44 set VS_ADDITIONAL_ARGUMENTS=%~1
\r
47 :: Setup Windows environment.
\r
48 call %RUN_MSBUILD_SCRIPT_PATH%setup-windows-env.bat
\r
50 :: Setup VS msbuild environment.
\r
51 call %RUN_MSBUILD_SCRIPT_PATH%setup-vs-msbuild-env.bat
\r
53 set VS_BUILD_ARGS=/p:Configuration=%VS_CONFIGURATION% /p:Platform=%VS_PLATFORM% %VS_ADDITIONAL_ARGUMENTS% /t:%VS_TARGET%
\r
54 call msbuild.exe %VS_BUILD_ARGS% "%RUN_MSBUILD_SCRIPT_PATH%mono.sln" && (
\r
58 if not %ERRORLEVEL% == 0 (
\r
59 set BUILD_RESULT=%ERRORLEVEL%
\r
63 exit /b %BUILD_RESULT%
\r