switch to cmake, find new headers (#3630)

This commit is contained in:
Chris Wolfe 2020-04-12 17:26:12 -07:00 committed by GitHub
parent 1eea5653d2
commit 345abf4d38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -16,7 +16,7 @@
FROM gcr.io/oss-fuzz-base/base-builder
MAINTAINER chriswwolfe@gmail.com
RUN apt-get update && apt-get install -y make autoconf automake libtool
RUN apt-get update && apt-get install -y make cmake
RUN git clone --depth 1 https://github.com/json-c/json-c.git json-c
WORKDIR json-c
COPY build.sh *.cc *.dict $SRC/

View File

@ -14,17 +14,17 @@
# limitations under the License.
#
################################################################################
./autogen.sh
./configure --enable-static --disable-shared
make -j$(nproc) all
ar rc json_c.a *.o
mkdir json-c-build
cd json-c-build
cmake -DBUILD_SHARED_LIBS=OFF ..
make -j$(nproc)
cd ..
cp $SRC/*.dict $OUT/
for f in $SRC/*_fuzzer.cc; do
fuzzer=$(basename "$f" _fuzzer.cc)
$CXX $CXXFLAGS -std=c++11 -I$SRC/json-c \
$CXX $CXXFLAGS -std=c++11 -I$SRC/json-c -I$SRC/json-c/json-c-build\
$SRC/${fuzzer}_fuzzer.cc -o $OUT/${fuzzer}_fuzzer \
$LIB_FUZZING_ENGINE $SRC/json-c/json_c.a
$LIB_FUZZING_ENGINE $SRC/json-c/json-c-build/libjson-c.a
done