1 echo off 2 REM 3 REM This Windows batch file builds this repository for the following targets: 4 REM 64-bit Debug 5 REM 64-bit Release 6 REM 32-bit Debug 7 REM 32-bit Release 8 REM It uses CMake to genererate the project files and then invokes msbuild 9 REM to build them. 10 REM The update_external_sources.bat batch file must be executed before running 11 REM this batch file 12 REM 13 14 REM Determine the appropriate CMake strings for the current version of Visual Studio 15 echo Determining VS version 16 python .\determine_vs_version.py > vsversion.tmp 17 set /p VS_VERSION=< vsversion.tmp 18 echo Detected Visual Studio Version as %VS_VERSION% 19 del /Q /F vsversion.tmp 20 21 rmdir /Q /S build 22 rmdir /Q /S build32 23 24 REM ******************************************* 25 REM 64-bit build 26 REM ******************************************* 27 mkdir build 28 pushd build 29 30 echo Generating 64-bit CMake files for Visual Studio %VS_VERSION% 31 cmake -G "Visual Studio %VS_VERSION% Win64" .. 32 33 echo Building 64-bit Debug 34 msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet 35 if errorlevel 1 ( 36 echo. 37 echo 64-bit Debug build failed! 38 popd 39 exit /B 1 40 ) 41 42 echo Building 64-bit Release 43 msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet 44 if errorlevel 1 ( 45 echo. 46 echo 64-bit Release build failed! 47 popd 48 exit /B 1 49 ) 50 51 popd 52 53 REM ******************************************* 54 REM 32-bit build 55 REM ******************************************* 56 mkdir build32 57 pushd build32 58 59 echo Generating 32-bit CMake files for Visual Studio %VS_VERSION% 60 cmake -G "Visual Studio %VS_VERSION%" .. 61 62 echo Building 32-bit Debug 63 msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet 64 if errorlevel 1 ( 65 echo. 66 echo 32-bit Debug build failed! 67 popd 68 exit /B 1 69 ) 70 71 echo Building 32-bit Release 72 msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet 73 if errorlevel 1 ( 74 echo. 75 echo 32-bit Release build failed! 76 popd 77 exit /B 1 78 ) 79 80 popd 81 exit /b 0 82