Welcome to mirror list, hosted at ThFree Co, Russian Federation.

run-msbuild.bat « msvc - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aae07978a310d3b7a9660eb414e4bf2be80f86f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
:: Set up build environment and run execute msbuild with all supplied arguments.

:: Arguments:
:: -------------------------------------------------------
:: %1 Visual Studio target, build|clean, default build
:: %2 Host CPU architecture, x86_64|i686, default x86_64
:: %3 Visual Studio configuration, debug|release, default release
:: %4 Additional arguments passed to msbuild, needs to be quoted if multiple.
:: %5 Project to build.
:: -------------------------------------------------------

@echo off
setlocal

set BUILD_RESULT=1

:: Get path for current running script.
set RUN_MSBUILD_SCRIPT_PATH=%~dp0

:: Configure all known build arguments.
set VS_TARGET=build
if /i "%~1" == "clean" (
    set VS_TARGET="clean"
)
shift

set VS_PLATFORM=x64
if /i "%~1" == "i686" (
    set VS_PLATFORM="Win32"
)
if /i "%~1" == "win32" (
    set VS_PLATFORM="Win32"
)
shift

set VS_CONFIGURATION=Release
if /i "%~1" == "debug" (
    set VS_CONFIGURATION="Debug"
)
shift

set VS_TARGET_GC=sgen
if /i "%~1" == "boehm" (
    set VS_TARGET_GC="boehm"
)
shift

set VS_ADDITIONAL_ARGUMENTS=
if not "%~1" == "" (
    set VS_ADDITIONAL_ARGUMENTS=%~1
)
shift

set VS_BUILD_PROJ=mono.sln
if /i not "%~1" == "" (
    set VS_BUILD_PROJ=%~1
)

if not exist %VS_BUILD_PROJ% (
    set VS_BUILD_PROJ=%RUN_MSBUILD_SCRIPT_PATH%%VS_BUILD_PROJ%
)

:: Setup Windows environment.
call %RUN_MSBUILD_SCRIPT_PATH%setup-windows-env.bat

:: Setup VS msbuild environment.
call %RUN_MSBUILD_SCRIPT_PATH%setup-vs-msbuild-env.bat

if "%VS_ADDITIONAL_ARGUMENTS%" == "" (
    set "VS_ADDITIONAL_ARGUMENTS=/p:PlatformToolset=%VS_DEFAULT_PLATFORM_TOOL_SET%"
)

set VS_BUILD_ARGS=/p:Configuration=%VS_CONFIGURATION% /p:Platform=%VS_PLATFORM% /p:MONO_TARGET_GC=%VS_TARGET_GC% %VS_ADDITIONAL_ARGUMENTS% /t:%VS_TARGET% /m
call msbuild.exe %VS_BUILD_ARGS% "%VS_BUILD_PROJ%" && (
    set BUILD_RESULT=0
) || (
    set BUILD_RESULT=1
    if not %ERRORLEVEL% == 0 (
        set BUILD_RESULT=%ERRORLEVEL%
    )
)

exit /b %BUILD_RESULT%

@echo on