1 :: Set up build environment and build LLVM using MSVC and msbuild targets in mono.sln.
\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 Mono MSVC source folder.
\r
9 :: %5 LLVM build directory.
\r
10 :: %6 LLVM install directory.
\r
11 :: %7 Additional arguments passed to msbuild, needs to be quoted if multiple.
\r
12 :: -------------------------------------------------------
\r
19 :: Get path for current running script.
\r
20 set RUN_BUILD_LLVM_MSBUILD_SCRIPT_PATH=%~dp0
\r
22 :: Configure all known build arguments.
\r
25 if /i "%~1" == "clean" (
\r
26 set VS_TARGET="clean"
\r
31 if /i "%~1" == "i686" (
\r
32 set VS_PLATFORM="Win32"
\r
34 if /i "%~1" == "win32" (
\r
35 set VS_PLATFORM="Win32"
\r
39 set VS_CONFIGURATION=Release
\r
40 if /i "%~1" == "debug" (
\r
41 set VS_CONFIGURATION="Debug"
\r
45 set MONO_MSVC_SOURCE_DIR=%RUN_BUILD_LLVM_MSBUILD_SCRIPT_PATH%..\msvc\
\r
46 if not "%~1" == "" (
\r
47 set MONO_MSVC_SOURCE_DIR=%~1
\r
51 set MONO_LLVM_BUILD_DIR=
\r
52 if not "%~1" == "" (
\r
53 set MONO_LLVM_BUILD_DIR=%~1
\r
57 set MONO_LLVM_INSTALL_DIR=
\r
58 if not "%~1" == "" (
\r
59 set MONO_LLVM_INSTALL_DIR=%~1
\r
63 set "VS_ADDITIONAL_ARGUMENTS=/p:PlatformToolset=v140 /p:MONO_TARGET_GC=sgen"
\r
64 if not "%~1" == "" (
\r
65 set VS_ADDITIONAL_ARGUMENTS=%~1
\r
68 :: Setup Windows environment.
\r
69 call %MONO_MSVC_SOURCE_DIR%setup-windows-env.bat
\r
71 :: Setup VS msbuild environment.
\r
72 call %MONO_MSVC_SOURCE_DIR%setup-vs-msbuild-env.bat
\r
74 if not "%MONO_LLVM_BUILD_DIR%" == "" (
\r
75 set VS_BUILD_ARGS=/p:_LLVMBuildDir="%MONO_LLVM_BUILD_DIR%"
\r
78 if not "%MONO_LLVM_INSTALL_DIR%" == "" (
\r
79 set VS_BUILD_ARGS=%VS_BUILD_ARGS% /p:_LLVMInstallDir="%MONO_LLVM_INSTALL_DIR%"
\r
82 set VS_BUILD_ARGS=%VS_BUILD_ARGS% /p:MONO_ENABLE_LLVM=true /p:Configuration=%VS_CONFIGURATION% /p:Platform=%VS_PLATFORM% %VS_ADDITIONAL_ARGUMENTS% /t:%VS_TARGET%
\r
83 call msbuild.exe %VS_BUILD_ARGS% "%MONO_MSVC_SOURCE_DIR%build-external-llvm.vcxproj" && (
\r
87 if not %ERRORLEVEL% == 0 (
\r
88 set BUILD_RESULT=%ERRORLEVEL%
\r
92 exit /b %BUILD_RESULT%
\r