add build script

This commit is contained in:
randy408 2019-10-14 17:12:13 +02:00
parent bd1a375028
commit dc56e24f7f
1 changed files with 19 additions and 0 deletions

19
fuzzing/ossfuzz.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash -eu
# This script is meant to be run by
# https://github.com/google/oss-fuzz/blob/master/projects/cjson/Dockerfile
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_CJSON_TEST=OFF ..
make -j$(nproc)
$CXX $CXXFLAGS -std=c++11 -I. \
$SRC/cjson/fuzzing/cjson_read_fuzzer.cc \
-o $OUT/cjson_read_fuzzer \
$LIB_FUZZING_ENGINE $SRC/cjson/build/libcjson.a
find $SRC/cjson/fuzzing/inputs -name "*" | \
xargs zip $OUT/cjson_read_fuzzer_seed_corpus.zip
cp $SRC/cjson/fuzzing/json.dict $OUT/cjson_read_fuzzer.dict