-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·35 lines (28 loc) · 936 Bytes
/
build.sh
File metadata and controls
executable file
·35 lines (28 loc) · 936 Bytes
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
#!/bin/sh
set -xe
CXX="${CXX:-g++}"
PKGS="sdl2 glew"
CXXFLAGS="-Wall -Wextra -Wswitch-enum -std=c++17 -pedantic -fno-exceptions -ggdb"
if [ `uname` = "Darwin" ]; then
CXXFLAGS+=" -framework OpenGL"
fi
while [ $# -gt 0 ]; do
case $1 in
--release)
export SOMETHING_RELEASE="1"
;;
*)
echo "ERROR: Unknown flag $1"
exit 1
;;
esac
shift
done
$CXX $CXXFLAGS -o config_indexer src/config_indexer.cpp src/config_parser.cpp
if [ "$SOMETHING_RELEASE" ]; then
./config_indexer --bake ./assets/vars.conf > ./src/config_index.hpp
$CXX $CXXFLAGS -O3 `pkg-config --cflags $PKGS` -DSOMETHING_RELEASE -o something.release src/something.cpp `pkg-config --libs $PKGS`
else
./config_indexer ./assets/vars.conf > ./src/config_index.hpp
$CXX $CXXFLAGS `pkg-config --cflags $PKGS` -o something.debug src/something.cpp `pkg-config --libs $PKGS`
fi