build_fuzzers.sh 651 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. #
  3. # Builds the fuzzers
  4. #
  5. # By Paul Dreik 20200923
  6. set -exu
  7. CATCHROOT=$(readlink -f $(dirname $0)/..)
  8. BUILDDIR=$CATCHROOT/build-fuzzers
  9. mkdir -p $BUILDDIR
  10. cd $BUILDDIR
  11. if which /usr/lib/ccache/clang++ >/dev/null 2>&1 ; then
  12. CXX=/usr/lib/ccache/clang++
  13. else
  14. CXX=clang++
  15. fi
  16. cmake $CATCHROOT \
  17. -DCMAKE_CXX_COMPILER=$CXX \
  18. -DCMAKE_CXX_FLAGS="-fsanitize=fuzzer-no-link,address,undefined -O3 -g" \
  19. -DCATCH_DEVELOPMENT_BUILD=On \
  20. -DCATCH_BUILD_EXAMPLES=Off \
  21. -DCATCH_BUILD_EXTRA_TESTS=Off \
  22. -DCATCH_BUILD_TESTING=Off \
  23. -DBUILD_TESTING=Off \
  24. -DCATCH_ENABLE_WERROR=Off \
  25. -DCATCH_BUILD_FUZZERS=On
  26. cmake --build . -j $(nproc)