dynarmic/fuzzing/build_fuzzers.sh
Merry 6879e5bb1c Squashed 'externals/catch/' content from commit ab6c7375b
git-subtree-dir: externals/catch
git-subtree-split: ab6c7375be9a8e71ee84c6f8537113f9f47daf99
2022-12-31 17:28:39 +00:00

33 lines
651 B
Bash
Executable file

#!/bin/sh
#
# Builds the fuzzers
#
# By Paul Dreik 20200923
set -exu
CATCHROOT=$(readlink -f $(dirname $0)/..)
BUILDDIR=$CATCHROOT/build-fuzzers
mkdir -p $BUILDDIR
cd $BUILDDIR
if which /usr/lib/ccache/clang++ >/dev/null 2>&1 ; then
CXX=/usr/lib/ccache/clang++
else
CXX=clang++
fi
cmake $CATCHROOT \
-DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_CXX_FLAGS="-fsanitize=fuzzer-no-link,address,undefined -O3 -g" \
-DCATCH_DEVELOPMENT_BUILD=On \
-DCATCH_BUILD_EXAMPLES=Off \
-DCATCH_BUILD_EXTRA_TESTS=Off \
-DCATCH_BUILD_TESTING=Off \
-DBUILD_TESTING=Off \
-DCATCH_ENABLE_WERROR=Off \
-DCATCH_BUILD_FUZZERS=On
cmake --build . -j $(nproc)