1SETLOCAL EnableDelayedExpansion
2
3@REM  # Possibilities:
4@REM  # Debug build + coverage
5@REM  # Debug build + examples
6@REM  # Debug build +   ---
7@REM  # Release build
8if "%CONFIGURATION%"=="Debug" (
9  if "%coverage%"=="1" (
10    @REM # coverage needs to build the special helper as well as the main
11    cmake -Hmisc -Bbuild-misc -A%PLATFORM% || exit /b !ERRORLEVEL!
12    cmake --build build-misc || exit /b !ERRORLEVEL!
13    cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind || exit /b !ERRORLEVEL! || exit /b !ERRORLEVEL!
14  ) else (
15    @REM # We know that coverage is 0
16    python scripts\generateSingleHeader.py || exit /b !ERRORLEVEL!
17    cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% || exit /b !ERRORLEVEL!
18  )
19)
20if "%CONFIGURATION%"=="Release" (
21  cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% || exit /b !ERRORLEVEL!
22)
23