X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=build-posix.sh;h=f7a56f0c52b951770fc617ab05f9f987e6e53068;hb=89a5e92725bfa7cbc94f8e5d2b79a66c4d5f263d;hp=e9124d819c8f4b5d17a6742ff664e39b02feeaa4;hpb=de19a40dab09dfe8eebbf2a3f9ed08731315d17b;p=nothing.git diff --git a/build-posix.sh b/build-posix.sh index e9124d81..f7a56f0c 100755 --- a/build-posix.sh +++ b/build-posix.sh @@ -4,6 +4,19 @@ set -xe 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/" +if [ ! -z "$NOTHING_CI" ]; then + CFLAGS="$CFLAGS -Werror" +fi + +if [ ! -z "$NOTHING_PROFILE" ]; then + CFLAGS="$CFLAGS -pg" +fi + LIBS="$LIBS $(pkg-config --libs sdl2) -lm" +if [ ${#CC} -eq "0" ]; then + echo "CC variable is not set up!" + exit 1 +fi + $CC $CFLAGS -o nothing nothing.c $LIBS