-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
82 lines (68 loc) · 1.59 KB
/
Copy pathbuild.bat
File metadata and controls
82 lines (68 loc) · 1.59 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@echo off
setlocal enabledelayedexpansion
if "%~1"=="" goto :usage
if "%~1"=="run" (
if "%~2"=="" goto :run_debug
if "%~2"=="--debug" goto :run_debug
if "%~2"=="--release" goto :run_release
echo Invalid option. Use --debug or --release.
exit /b 1
)
if "%~1"=="build" (
if "%~2"=="" goto :build_debug
if "%~2"=="--debug" goto :build_debug
if "%~2"=="--release" goto :build_release
if "%~2"=="--all" goto :build_all
echo Invalid option. Use --debug or --release or --all.
exit /b 1
)
if "%~1"=="clean" (
if "%~2"=="--debug" goto :clean_debug
if "%~2"=="--release" goto :clean_release
goto :clean_all
)
if "%~1"=="help" goto :usage
:usage
echo Usage: build.bat [run^|build^|clean^|help] [--debug^|--release^|--all]
exit /b 1
:run_debug
call :build_debug
.\out\win-debug\main.exe
exit /b 0
:run_release
call :build_release
.\out\win-release\main.exe
exit /b 0
:build_debug
echo Building debug version...
cmake --preset win-debug
cmake --build ./out/win-debug
exit /b 0
:build_release
echo Building release version...
cmake --preset win-release
cmake --build ./out/win-release
exit /b 0
:build_all
echo Building both debug and release versions...
call :build_debug
call :build_release
exit /b 0
:clean_debug
if exist ".\out\win-debug" (
rmdir /s /q ".\out\win-debug"
echo Cleaned debug build directory.
)
exit /b 0
:clean_release
if exist ".\out\win-release" (
rmdir /s /q ".\out\win-release"
echo Cleaned release build directory.
)
exit /b 0
:clean_all
if exist ".\out" (
rmdir /s /q ".\out"
echo Cleaned all build directories.
)
exit /b 0