Merge pull request #12254 from marek-safar/bcl-fixes
[mono-project.git] / msvc / llvm-cmake-config.bat
blob43bf8d6b58a4ba50d11e9d5b7ecdb1d2da30fd56
1 @ECHO OFF\r
2 \r
3 SET TEMP_PATH=%PATH%\r
4 \r
5 REM Update PATH to include local cmake and phython installations.\r
6 REM SET PATH="C:\tools\cmake-3.10.2-win32-x86\bin";"C:\tools\python2.2.7.15\tools\";%PATH%\r
7 \r
8 SET TOP=%1
9 IF "" == "%TOP%" (
10         ECHO Error, first script parameter should be LLVM source folder.
11         GOTO ON_ERROR
14 IF NOT EXIST "%TOP%" (
15         ECHO Error, could not find "%TOP%".
16         GOTO ON_ERROR
17 )\r
19 IF NOT EXIST "%~dp0mono.sln" (\r
20         ECHO Error, script bust be located in same directory as mono.sln file.
21         GOTO ON_ERROR\r
22 )\r
24 SET LLVM_SRC_PATH=%TOP%\r
25 SET LLVM_BUILD_PATH=%TOP%\llvm-build\r
27 REM Update to reflect value used in mono.props, MONO_LLVM_INSTALL_DIR_PREFIX property.\r
28 SET LLVM_INSTALL_PATH=%~dp0dist\llvm\r
30 SET CROSS_CMAKE_FLAGS=^\r
31 -DCMAKE_INSTALL_PREFIX="%LLVM_INSTALL_PATH%" ^\r
32 -DCMAKE_BUILD_TYPE=Release ^\r
33 -DLLVM_ENABLE_ZLIB=OFF ^\r
34 -DLLVM_TARGETS_TO_BUILD="X86" ^\r
35 -DCMAKE_CROSSCOMPILING=False ^\r
36 -DCMAKE_SYSTEM_NAME=Windows\r
38 SET TEMP_WD=%CD%\r
39 cd %LLVM_BUILD_PATH%\r
40 ECHO cmake.exe -G "Visual Studio 14 2015 Win64" %CROSS_CMAKE_FLAGS% %LLVM_SRC_PATH%\r
41 cmake.exe -G "Visual Studio 14 2015 Win64" %CROSS_CMAKE_FLAGS% %LLVM_SRC_PATH%\r
42 cd %TEMP_WD%\r
44 :ON_ERROR\r
45         SET CONFIG_RESULT=ERRORLEVEL
46         GOTO ON_EXIT\r
48 :ON_EXIT\r
49         SET PATH=%TEMP_PATH%\r
50         EXIT /b %CONFIG_RESULT%\r
52 @ECHO ON