]> git.lizzy.rs Git - nothing.git/blob - build-posix.sh
(#1180) return -> exit 1
[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 LIBS="$LIBS $(pkg-config --libs sdl2) -lm"
12
13 if [ ${#CC} -eq "0" ]; then
14     echo "CC variable is not set up!"
15     exit 1
16 fi
17
18 $CC $CFLAGS -o nothing nothing.c $LIBS