aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-02-28 00:02:41 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commitcff67f93caeb3f98261860904dd232f6b551299e (patch)
tree94715ee98cc0ea62ea60da96b8b2d3a595b5276e /build.sh
parent0ed62b9337c64a91481afd91f9e5706a36eca7b5 (diff)
fix crashes
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 47fdc04..b3dfc9f 100755
--- a/build.sh
+++ b/build.sh
@@ -10,8 +10,15 @@ if [ -z "$CC" ]; then
CC=cc
fi
-CFLAGS="-Wall -Wextra -Werror -g -O0 -DDEBUG -std=c89 -pedantic -fsanitize=address -D_GNU_SOURCE"
-LIBS="-pthread -lasan"
+CFLAGS=""
+LIBS=""
+if [ ! -z "$SANITIZE_ADDRESS" ]; then
+ CFLAGS+="-fsanitize=address "
+ LIBS+="-lasan "
+fi
+
+CFLAGS+="-Wall -Wextra -Werror -g -O0 -DDEBUG -std=c89 -pedantic -D_GNU_SOURCE"
+LIBS+="-pthread"
set -x
time "$CC" $source_files $CFLAGS $LIBS -o amalgam