From 270e466d750f4cf70dd3759d9750e8b28e7f1dba Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 25 Mar 2019 14:41:47 +0100 Subject: [PATCH] Add build rule for fuzzer-api Signed-off-by: Stefan Weil --- Makefile.am | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Makefile.am b/Makefile.am index 426f023e..e427170e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,3 +64,17 @@ doc-clean: pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = tesseract.pc + +# fuzzer-api is used for fuzzing tests. +# They are run by OSS-Fuzz https://oss-fuzz.com/, but can also be run locally. +# Note: -fsanitize=fuzzer currently requires the clang++ compiler. +fuzzer-api: all +fuzzer-api: $(top_srcdir)/unittest/fuzzers/fuzzer-api.cpp + $(CXX) $(CXXFLAGS) -g -fsanitize=fuzzer \ + -I $(top_srcdir)/src/api \ + -I $(top_srcdir)/src/ccmain \ + -I $(top_srcdir)/src/ccstruct \ + -I $(top_srcdir)/src/ccutil \ + -I src/api \ + $< \ + src/api/.libs/libtesseract.a $(LEPTONICA_LIBS) $(libarchive_LIBS) -o $@