Use out of source build

This commit is contained in:
Abdelrahman Said 2024-06-09 16:19:44 +01:00
parent 9008e10651
commit 7e1c25b649

View File

@ -30,6 +30,11 @@ SRC="\
TEST_SRC="\ TEST_SRC="\
$(find tests -type f -name "*.c" | xargs -I{} echo -n "{} ") \ $(find tests -type f -name "*.c" | xargs -I{} echo -n "{} ") \
" "
BUILD_DIR="libwapp-build/posix-$BUILD_TYPE"
if [[ -d $BUILD_DIR ]]; then
rm -rf $BUILD_DIR
fi
mkdir -p $BUILD_DIR
if [[ $BUILD_TYPE == "release" ]]; then if [[ $BUILD_TYPE == "release" ]]; then
CFLAGS+="-O3" CFLAGS+="-O3"
@ -37,8 +42,8 @@ else
CFLAGS+="-g -fsanitize=address -fsanitize=undefined" CFLAGS+="-g -fsanitize=address -fsanitize=undefined"
fi fi
OUT="libwapp.so" OUT="$BUILD_DIR/libwapp.so"
TEST_OUT="./wapptest" TEST_OUT="$BUILD_DIR/wapptest"
# Compile tests # Compile tests
if [[ $(echo $TEST_SRC | xargs) != "" ]]; then if [[ $(echo $TEST_SRC | xargs) != "" ]]; then