From 7593eb473275a0035384fad1df5babecd6766031 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 26 May 2024 15:54:01 +0100 Subject: [PATCH] Add release build --- compile | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/compile b/compile index 1f9f224..52386c0 100755 --- a/compile +++ b/compile @@ -1,7 +1,28 @@ #!/bin/bash +BUILD_TYPE="debug" + +while [[ $# > 0 ]];do + case $1 in + --release) + BUILD_TYPE="release" + shift + ;; + *|-*|--*) + echo "Unknown option $1" + exit 1 + ;; + esac +done + CC=clang -CFLAGS="-g -Wall -Werror -pedantic -fsanitize=address -fsanitize=undefined -DDEBUG" + +if [[ $BUILD_TYPE == "release" ]]; then + CFLAGS="-O3 -Wall -Werror -pedantic" +else + CFLAGS="-g -Wall -Werror -pedantic -fsanitize=address -fsanitize=undefined -DDEBUG" +fi + INCLUDES="\ -I$(find ./src -type d | xargs -I{} echo -n "-I{} ") \ $(find intern/wizapp/src -type d | xargs -I{} echo -n "-I{} ") \