summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index ae62e50..69bf12f 100755
--- a/build.sh
+++ b/build.sh
@@ -1,9 +1,11 @@
#!/bin/sh
set -e
+version="$(git describe --tags --first-parent --abbrev=40 --long --dirty --always)"
+
CC=cc
SAN="$SAN -fsanitize=address -fsanitize=undefined -fsanitize=leak"
-CFLAGS="$CFLAGS -g -O0 -DENABLE_ASSERT=1 -DENABLE_DEBUG=1"
+CFLAGS="$CFLAGS -g -O0 -DENABLE_ASSERT=1 -DENABLE_DEBUG=1 -DVERSION=\"$version\""
CFLAGS="$CFLAGS -Wall -Wextra -Weverything -pedantic"
CFLAGS="$CFLAGS -Wno-unsafe-buffer-usage -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-declaration-after-statement -Wno-padded -Wno-covered-switch-default -Wno-gnu-empty-struct -Wno-c++-compat -Wno-alloca -Wno-zero-length-array"