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