-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.bat
45 lines (37 loc) · 1.09 KB
/
build.bat
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
@echo off
setlocal enabledelayedexpansion
g++ --version
for %%f in ("%~dp0..") do set root=%%~ff
echo Got root of repository: %root%
if not exist %root%\build mkdir %root%\build
set before=-O3 -Wall -I %root%\extern\regex\include -I %root%\src\include -std=c++17
set after=-l pathcch -l wininet
if "%1"=="debug" (
set before=-D DEBUG -g %before%
set debug=true
echo Building in debug mode
) else (
set debug=false
)
if "%1"=="assembly" (
set before=-S -fverbose-asm %before%
set assembly=true
echo Compiling to assembly
) else (
set assembly=false
)
if "%assembly%" == "true" (
set extension=asm
) else (
set extension=exe
)
echo Building %root%\src\shell.cpp to %root%\build\shell.%extension%
g++ %before% %root%\src\shell.cpp %after% -o %root%\build\shell.%extension%
if %errorlevel% neq 0 exit /b %errorlevel%
for %%f in (%root%\src\external\*) do (
if "%%~xf" == ".cpp" (
echo Building %%f to %root%\build\%%~nf.%extension%
g++ %before% %%f %after% -o %root%\build\%%~nf.%extension%
if !errorlevel! neq 0 exit /b !errorlevel!
)
)