From 80e83ad35c11919e9f9737d72c04d30c60fd78d3 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Fri, 12 Jan 2024 16:35:45 +0100 Subject: Clang build scripts --- build_and_test.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build_and_test.sh b/build_and_test.sh index b3a3f2d..019e05c 100644 --- a/build_and_test.sh +++ b/build_and_test.sh @@ -114,7 +114,7 @@ if [ "$COMPILE" != "emcc" ]; then esac fi -if [ "$COMPILE" = "gcc" ] || [ "$COMPILE" = "clang" ] || [ "$COMPILE" = "emcc" ]; then +if [ "$COMPILE" = "gcc" ] || [ "$COMPILE" = "emcc" ]; then if [ "$1" = "release" ]; then FLAGS="-O3 -DNDEBUG" elif [ "$COMPILE" = "gcc" ] && [ "$OS" != "Windows" ]; then @@ -124,6 +124,12 @@ if [ "$COMPILE" = "gcc" ] || [ "$COMPILE" = "clang" ] || [ "$COMPILE" = "emcc" ] else FLAGS="-O0" fi +elif [ "$COMPILE" = "clang" ]; then + if [ "$1" = "release" ]; then + FLAGS="-O3 -DNDEBUG" + else + FLAGS="-O0" + fi else if [ "$1" = "release" ]; then FLAGS="-O2 -DNDEBUG" @@ -134,6 +140,8 @@ fi if [ "$COMPILE" = "clang" ] || [ "$OS" = "macOS" ]; then FLAGS="-fblocks ${FLAGS}" + LINK_FLAGS="-lBlocksRuntime ${LINK_FLAGS}" + COMPILEPP="${COMPILEPP} -stdlib=libc++" fi if [ ! -d "$FOLDER" ]; then -- cgit v1.2.3