-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathbuild.bat
More file actions
50 lines (43 loc) · 1.57 KB
/
Copy pathbuild.bat
File metadata and controls
50 lines (43 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@echo off
setlocal EnableDelayedExpansion
REM Always run from the script directory.
cd /d "%~dp0"
REM ---------------------------------------------------------------------------
REM Configurable build options
REM GENERATOR - CMake generator (default: auto-detect)
REM ARCH - Architecture for multi-config generators (default: x64)
REM CONFIGS - Configurations to build, space-separated (default: Release Debug)
REM ---------------------------------------------------------------------------
if "%GENERATOR%"=="" (
where ninja >nul 2>nul
if not errorlevel 1 (
set "GENERATOR=Ninja Multi-Config"
) else (
set "GENERATOR=Visual Studio 17 2022"
)
)
if "%ARCH%"=="" set "ARCH=x64"
if "%CONFIGS%"=="" set "CONFIGS=Release Debug"
echo [INFO] Configuring with generator: %GENERATOR%
echo "%GENERATOR%" | findstr /I /C:"Visual Studio" >nul
if not errorlevel 1 (
cmake -S src -B build -G "%GENERATOR%" -A %ARCH%
) else (
cmake -S src -B build -G "%GENERATOR%"
)
if errorlevel 1 goto :fail
for %%C in (%CONFIGS%) do (
echo [INFO] Building: %%C
cmake --build build --config %%C
if errorlevel 1 goto :fail
REM extract_tickets is EXCLUDE_FROM_ALL, so build it explicitly. It lands in
REM build\tools\%%C\ rather than the shipped output directory.
echo [INFO] Building tool extract_tickets for %%C
cmake --build build --config %%C --target extract_tickets
if errorlevel 1 goto :fail
)
echo [OK] Build completed successfully.
exit /b 0
:fail
echo [ERROR] Build failed.
exit /b 1