-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
66 lines (58 loc) · 1.37 KB
/
build.bat
File metadata and controls
66 lines (58 loc) · 1.37 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
@echo off
title Compile AetherEngine
setlocal enabledelayedexpansion
:: ==============================
:: CMake setup choice
:: ==============================
:cmakesetup
echo.
echo Setup CMAKE? (y/n)
set /p setupcmake=[input]:
set "setupcmake=%setupcmake: =%" :: trim spaces
if /i "%setupcmake%"=="y" (
set "cmakeconfig=SETUPANDBUILD"
) else if /i "%setupcmake%"=="n" (
set "cmakeconfig=BUILD"
) else (
echo Invalid input!
goto cmakesetup
)
:: ==============================
:: Build type choice
:: ==============================
:buildsetup
echo.
echo Is this a release build? (y/n)
set /p isrelease=[input]:
set "isrelease=%isrelease: =%"
if /i "%isrelease%"=="y" (
set "buildconfig=RELEASE"
) else if /i "%isrelease%"=="n" (
set "buildconfig=DEBUG"
) else (
echo Invalid input!
goto buildsetup
)
echo.
echo ==============================
echo CMake Mode: %cmakeconfig%
echo Build Mode: %buildconfig%
echo ==============================
echo.
:: ==============================
:: Run commands
:: ==============================
if "%cmakeconfig%"=="SETUPANDBUILD" (
echo Running CMake setup...
cmake -S . -B build
)
if /i "%buildconfig%"=="RELEASE" (
echo Building in Release mode...
cmake --build build --config Release
) else (
echo Building in Debug mode...
cmake --build build --config Debug
)
echo.
echo Build complete.
pause