| # Copyright 2016 The PDFium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("../../pdfium.gni") |
| |
| config("libfuzzer_config") { |
| configs = [ "../..:pdfium_core_config" ] |
| |
| defines = [ |
| "PNG_PREFIX", |
| "PNG_USE_READ_MACROS", |
| ] |
| include_dirs = [ "../.." ] |
| if (pdf_enable_v8) { |
| defines += [ "PDF_ENABLE_V8" ] |
| } |
| if (pdf_enable_xfa) { |
| defines += [ "PDF_ENABLE_XFA" ] |
| } |
| } |
| |
| group("libfuzzer") { |
| testonly = true |
| deps = [ |
| ":pdf_cmap_fuzzer", |
| ":pdf_codec_a85_fuzzer", |
| ":pdf_codec_fax_fuzzer", |
| ":pdf_codec_icc_fuzzer", |
| ":pdf_codec_jbig2_fuzzer", |
| ":pdf_codec_rle_fuzzer", |
| ":pdf_font_fuzzer", |
| ":pdf_hint_table_fuzzer", |
| ":pdf_jpx_fuzzer", |
| ":pdf_psengine_fuzzer", |
| ":pdf_streamparser_fuzzer", |
| ] |
| if (pdf_enable_xfa) { |
| deps += [ |
| ":pdf_cfx_barcode_fuzzer", |
| ":pdf_cfx_saxreader_fuzzer", |
| ":pdf_codec_bmp_fuzzer", |
| ":pdf_codec_gif_fuzzer", |
| ":pdf_codec_jpeg_fuzzer", |
| ":pdf_codec_png_fuzzer", |
| ":pdf_codec_tiff_fuzzer", |
| ":pdf_css_fuzzer", |
| ":pdf_fm2js_fuzzer", |
| ":pdf_xml_fuzzer", |
| ] |
| } |
| } |
| |
| template("pdfium_fuzzer") { |
| source_set(target_name) { |
| sources = invoker.sources + [ "pdf_fuzzer_init.cc" ] |
| deps = [ |
| "../..:pdfium", |
| ] |
| testonly = true |
| configs -= [ "//build/config/compiler:chromium_code" ] |
| configs += [ |
| "//build/config/compiler:no_chromium_code", |
| ":libfuzzer_config", |
| ] |
| } |
| } |
| |
| if (pdf_enable_xfa) { |
| pdfium_fuzzer("pdf_cfx_barcode_fuzzer") { |
| sources = [ |
| "pdf_cfx_barcode_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_cfx_saxreader_fuzzer") { |
| sources = [ |
| "pdf_cfx_saxreader_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_codec_bmp_fuzzer") { |
| sources = [ |
| "pdf_codec_bmp_fuzzer.cc", |
| "xfa_codec_fuzzer.h", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_codec_gif_fuzzer") { |
| sources = [ |
| "pdf_codec_gif_fuzzer.cc", |
| "xfa_codec_fuzzer.h", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_codec_jpeg_fuzzer") { |
| sources = [ |
| "pdf_codec_jpeg_fuzzer.cc", |
| "xfa_codec_fuzzer.h", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_codec_png_fuzzer") { |
| sources = [ |
| "pdf_codec_png_fuzzer.cc", |
| "xfa_codec_fuzzer.h", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_codec_tiff_fuzzer") { |
| sources = [ |
| "pdf_codec_tiff_fuzzer.cc", |
| "xfa_codec_fuzzer.h", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_css_fuzzer") { |
| sources = [ |
| "pdf_css_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_fm2js_fuzzer") { |
| sources = [ |
| "pdf_fm2js_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_xml_fuzzer") { |
| sources = [ |
| "pdf_xml_fuzzer.cc", |
| ] |
| } |
| } |
| |
| pdfium_fuzzer("pdf_cmap_fuzzer") { |
| sources = [ |
| "pdf_cmap_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_codec_a85_fuzzer") { |
| sources = [ |
| "pdf_codec_a85_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_codec_fax_fuzzer") { |
| sources = [ |
| "pdf_codec_fax_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_codec_icc_fuzzer") { |
| sources = [ |
| "pdf_codec_icc_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_codec_jbig2_fuzzer") { |
| sources = [ |
| "pdf_codec_jbig2_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_codec_rle_fuzzer") { |
| sources = [ |
| "pdf_codec_rle_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_font_fuzzer") { |
| sources = [ |
| "pdf_font_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_hint_table_fuzzer") { |
| sources = [ |
| "pdf_hint_table_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_jpx_fuzzer") { |
| sources = [ |
| "pdf_jpx_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_psengine_fuzzer") { |
| sources = [ |
| "pdf_psengine_fuzzer.cc", |
| ] |
| } |
| |
| pdfium_fuzzer("pdf_streamparser_fuzzer") { |
| sources = [ |
| "pdf_streamparser_fuzzer.cc", |
| ] |
| } |