[bcl] Update BCL Linked Size
[mono-project.git] / msvc / run-msbuild.bat
blobfd5633a23464f46397191d57573de4216c6fe72c
1 :: Set up build environment and run execute msbuild with all supplied arguments.\r
2 \r
3 :: 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
11 @echo off\r
12 setlocal\r
14 set BUILD_RESULT=1\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
21 set VS_TARGET=build\r
22 if /i "%~1" == "clean" (\r
23     set VS_TARGET="clean"\r
24 )\r
25 shift\r
27 set VS_PLATFORM=x64\r
28 if /i "%~1" == "i686" (\r
29     set VS_PLATFORM="Win32"\r
30 )\r
31 if /i "%~1" == "win32" (\r
32     set VS_PLATFORM="Win32"\r
33 )\r
34 shift\r
36 set VS_CONFIGURATION=Release\r
37 if /i "%~1" == "debug" (\r
38     set VS_CONFIGURATION="Debug"\r
39 )\r
40 shift\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
45 )\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
55     set BUILD_RESULT=0\r
56 ) || (\r
57     set BUILD_RESULT=1\r
58     if not %ERRORLEVEL% == 0 (\r
59         set BUILD_RESULT=%ERRORLEVEL%\r
60     )\r
61 )\r
63 exit /b %BUILD_RESULT%\r
65 @echo on