Add release build

This commit is contained in:
Abdelrahman Said 2024-05-26 15:54:01 +01:00
parent ec2835e900
commit 7593eb4732

23
compile
View File

@ -1,7 +1,28 @@
#!/bin/bash #!/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 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="\ INCLUDES="\
-I$(find ./src -type d | xargs -I{} echo -n "-I{} ") \ -I$(find ./src -type d | xargs -I{} echo -n "-I{} ") \
$(find intern/wizapp/src -type d | xargs -I{} echo -n "-I{} ") \ $(find intern/wizapp/src -type d | xargs -I{} echo -n "-I{} ") \