blob: 5561cc3ff25f371a9de12435c0486171264d38fa [file] [log] [blame]
#!/bin/bash
set -e
set -x
if [[ "$OSTYPE" == "darwin"* ]]; then
echo 'brew "cmake"
brew "ninja"
brew "sdl2"' | brew bundle --file=-
fi
git submodule init
git submodule update
WARNINGS="-fcolor-diagnostics -Werror -Weverything -Wno-c++98-compat -Wno-c++11-compat"
rm -rf out
mkdir -p out/dbg
cd out/dbg
cmake -G Ninja ../.. \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Debug \
-DDEV_TOOLS=ON \
-DRUN_TESTS=ON \
-DCMAKE_CXX_FLAGS="$WARNINGS -fsanitize=address,integer,undefined -fno-sanitize-recover=all"
cd -
mkdir -p out/dev
cd out/dev
cmake -G Ninja ../.. \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Debug \
-DDEV_TOOLS=ON \
-DDUMP_SIZE=ON \
-DRUN_BENCH=ON \
-DCMAKE_CXX_FLAGS="$WARNINGS -Os -momit-leaf-frame-pointer"
cd -
mkdir -p out/tidy
cd out/tidy
cmake -G Ninja ../.. \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Debug \
-DDEV_TOOLS=ON \
-DCMAKE_CXX_CLANG_TIDY="clang-tidy" \
-DCMAKE_CXX_FLAGS="$WARNINGS"
cd -