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 :: %5 Project to build.
\r
10 :: -------------------------------------------------------
\r
17 :: Get path for current running script.
\r
18 set RUN_MSBUILD_SCRIPT_PATH=%~dp0
\r
20 :: Configure all known build arguments.
\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
48 set VS_BUILD_PROJ=mono.sln
\r
49 if /i not "%~1" == "" (
\r
50 set VS_BUILD_PROJ=%~1
\r
53 if not exist %VS_BUILD_PROJ% (
\r
54 set VS_BUILD_PROJ=%RUN_MSBUILD_SCRIPT_PATH%%VS_BUILD_PROJ%
\r
57 :: Setup Windows environment.
\r
58 call %RUN_MSBUILD_SCRIPT_PATH%setup-windows-env.bat
\r
60 :: Setup VS msbuild environment.
\r
61 call %RUN_MSBUILD_SCRIPT_PATH%setup-vs-msbuild-env.bat
\r
63 set VS_BUILD_ARGS=/p:Configuration=%VS_CONFIGURATION% /p:Platform=%VS_PLATFORM% %VS_ADDITIONAL_ARGUMENTS% /t:%VS_TARGET% /m
\r
64 call msbuild.exe %VS_BUILD_ARGS% "%VS_BUILD_PROJ%" && (
\r
68 if not %ERRORLEVEL% == 0 (
\r
69 set BUILD_RESULT=%ERRORLEVEL%
\r
73 exit /b %BUILD_RESULT%
\r