]> git.lizzy.rs Git - nothing.git/blob - build-posix.sh
Merge pull request #1255 from tsoding/1253
[nothing.git] / build-posix.sh
1 #!/bin/sh
2
3 set -xe
4
5 CFLAGS="$CFLAGS -Wall -Wextra -Wconversion -Wunused -Wunused-function -Wunused-label -Wunused-macros -Wunused-parameter -Wunused-value -Wunused-variable -Wcast-align -Wcast-qual -Wmissing-declarations -Wredundant-decls -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings -Wswitch -Wmissing-field-initializers -fno-common -fno-strict-aliasing -pedantic -std=c11 -ggdb -O3 $(pkg-config --cflags sdl2) -I./src/"
6
7 if [ ! -z "$NOTHING_CI" ]; then
8     CFLAGS="$CFLAGS -Werror"
9 fi
10
11 if [ ! -z "$NOTHING_PROFILE" ]; then
12     CFLAGS="$CFLAGS -pg"
13 fi
14
15 LIBS="$LIBS $(pkg-config --libs sdl2) -lm"
16
17 if [ ${#CC} -eq "0" ]; then
18     echo "CC variable is not set up!"
19     exit 1
20 fi
21
22 $CC $CFLAGS -o nothing nothing.c $LIBS