diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2023-09-06 02:37:27 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2023-09-06 02:37:27 +0200 |
commit | 7ee126fdeaec9513bb0b97e075f3964b79c00582 (patch) | |
tree | 3c947e76e01e353dc6af5910efaa08bf69c35085 /build_and_test.sh | |
parent | 3cf844d8637ec31bbbba2997c106330991d67528 (diff) | |
download | kit-7ee126fdeaec9513bb0b97e075f3964b79c00582.zip |
time.h fixes; incomplete
Diffstat (limited to 'build_and_test.sh')
-rw-r--r-- | build_and_test.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/build_and_test.sh b/build_and_test.sh index 873bacf..7ed30c6 100644 --- a/build_and_test.sh +++ b/build_and_test.sh @@ -2,6 +2,7 @@ if [ ! -d "build" ]; then mkdir build fi +OS=Linux COMPILE=gcc COMPILEPP=g++ OBJ_POSTFIX=.o @@ -40,6 +41,7 @@ fi case $(uname | tr '[:upper:]' '[:lower:]') in *darwin*) + OS=macOS if [ "$2" = "" ]; then if command -v clang >/dev/null 2>&1; then echo "C compiler found - Clang" @@ -54,6 +56,7 @@ case $(uname | tr '[:upper:]' '[:lower:]') in fi ;; *msys*|*cygwin*|*mingw*|*nt*|*win*) + OS=Windows EXE_POSTFIX=.exe if [ "$2" = "" ]; then if command -v cl.exe >/dev/null 2>&1; then @@ -92,15 +95,15 @@ case $(uname | tr '[:upper:]' '[:lower:]') in ;; esac -echo "" - if [ "$COMPILE" = "gcc" ] || [ "$COMPILE" = "clang" ]; then if [ "$1" = "release" ]; then FLAGS="-O3" - elif [ "$COMPILE" = "gcc" ]; then + elif [ "$COMPILE" = "gcc" ] && [ "$OS" != "Windows" ]; then FLAGS="-O0 -fsanitize=undefined,address,leak" - else + elif [ "$OS" != "Windows" ]; then FLAGS="-O0 -fsanitize=undefined,address" + else + FLAGS="-O0" fi else if [ "$1" = "release" ]; then @@ -110,6 +113,8 @@ else fi fi +echo "" + $COMPILE ${FLAGS} \ ${FLAG_OBJ}"build/kit${OBJ_POSTFIX}" \ "source/kit/_static.c" |