-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild_msys2.bat
More file actions
33 lines (28 loc) · 1.03 KB
/
build_msys2.bat
File metadata and controls
33 lines (28 loc) · 1.03 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
SET CXX=g++
SET PKGS=sdl2 glew --static
SET CXXFLAGS=-Wall -Wextra -std=c++17 -pedantic -fno-exceptions -D_GNU_SOURCE
rem inspired https://stackoverflow.com/questions/2323292/assign-output-of-a-program-to-a-variable-using-a-ms-batch-file
pkg-config --cflags %PKGS% >temp.txt
set /p PKGSCFLAGS=<temp.txt
pkg-config --libs %PKGS% >temp.txt
set /p PKGLIBS=<temp.txt
del temp.txt
%CXX% %CXXFLAGS% -o config_indexer.exe src/config_indexer.cpp src/config_parser.cpp
setlocal
for %%i in (%*) do (
if "%%i" == "--release" (
set SOMETHING_RELEASE=1
) else (
echo ERROR: Unknown flag "%%i"
goto :eof
)
)
if defined SOMETHING_RELEASE (
config_indexer --bake assets/vars.conf >src/config_index.hpp
%CXX% %CXXFLAGS% -O3 %PKGSCFLAGS% -DSOMETHING_RELEASE -o something.release.exe src/something.cpp %PKGLIBS% -lopengl32 -static
) else (
config_indexer assets/vars.conf >src/config_index.hpp
%CXX% %CXXFLAGS% %PKGSCFLAGS% -o something.debug.exe src/something.cpp %PKGLIBS% -lopengl32 -static
)
endlocal
dir *.exe