Add platform detection to posix compilation script

This commit is contained in:
Abdelrahman Said 2025-02-23 15:32:13 +00:00
parent 491c742189
commit 19efb08a3a

@ -35,6 +35,9 @@ done
CC=clang
CFLAGS="-Wall -Wextra -Werror -pedantic"
LIBFLAGS="-fPIC -shared"
KERNEL="$(uname -s)"
MACHINE="$(uname -m)"
PLATFORM="${KERNEL}_${MACHINE}"
if [[ $CC == "gcc" ]]; then
# Used to disable the "ASan runtime does not come first in initial library list" error when compiling with gcc
@ -66,7 +69,7 @@ esac
TEST_INCLUDE="$(find tests -type d | xargs -I{} echo -n "-I{} ")"
TEST_SRC="$(find tests -type f -name "*.c" | xargs -I{} echo -n "{} ")"
BUILD_DIR="libwapp-build/posix-$BUILD_TYPE"
BUILD_DIR="libwapp-build/$PLATFORM-$BUILD_TYPE"
if [[ -d $BUILD_DIR ]]; then
rm -rf $BUILD_DIR
fi