Oliver Chang | e67d218 | 2016-02-16 11:42:07 -0800 | [diff] [blame] | 1 | # Copyright 2016 The PDFium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
dsinclair | 038bf0b | 2016-04-30 06:00:05 -0700 | [diff] [blame] | 5 | import("../../pdfium.gni") |
Oliver Chang | e67d218 | 2016-02-16 11:42:07 -0800 | [diff] [blame] | 6 | |
| 7 | config("libfuzzer_config") { |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 8 | configs = [ "../..:pdfium_core_config" ] |
dsinclair | 756d379 | 2016-06-14 07:34:20 -0700 | [diff] [blame] | 9 | |
Oliver Chang | e67d218 | 2016-02-16 11:42:07 -0800 | [diff] [blame] | 10 | defines = [ |
| 11 | "PNG_PREFIX", |
Oliver Chang | e67d218 | 2016-02-16 11:42:07 -0800 | [diff] [blame] | 12 | "PNG_USE_READ_MACROS", |
| 13 | ] |
| 14 | include_dirs = [ "../.." ] |
| 15 | if (pdf_enable_v8) { |
| 16 | defines += [ "PDF_ENABLE_V8" ] |
| 17 | } |
| 18 | if (pdf_enable_xfa) { |
| 19 | defines += [ "PDF_ENABLE_XFA" ] |
| 20 | } |
| 21 | } |
| 22 | |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 23 | group("libfuzzer") { |
| 24 | } |
| 25 | |
| 26 | template("pdfium_fuzzer") { |
| 27 | source_set(target_name) { |
| 28 | sources = invoker.sources |
| 29 | deps = [ |
| 30 | "../..:pdfium", |
| 31 | ] |
| 32 | testonly = true |
| 33 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 34 | configs += [ |
| 35 | "//build/config/compiler:no_chromium_code", |
| 36 | ":libfuzzer_config", |
| 37 | ] |
| 38 | } |
| 39 | } |
| 40 | |
Oliver Chang | e67d218 | 2016-02-16 11:42:07 -0800 | [diff] [blame] | 41 | if (pdf_enable_xfa) { |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 42 | pdfium_fuzzer("pdf_cfx_saxreader_fuzzer") { |
dsinclair | 5377267 | 2016-06-16 07:40:47 -0700 | [diff] [blame] | 43 | sources = [ |
| 44 | "pdf_cfx_saxreader_fuzzer.cc", |
| 45 | ] |
dsinclair | 5377267 | 2016-06-16 07:40:47 -0700 | [diff] [blame] | 46 | } |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 47 | |
| 48 | pdfium_fuzzer("pdf_codec_bmp_fuzzer") { |
dsinclair | 5a5f251 | 2016-06-06 11:52:30 -0700 | [diff] [blame] | 49 | sources = [ |
| 50 | "pdf_codec_bmp_fuzzer.cc", |
| 51 | "xfa_codec_fuzzer.h", |
| 52 | ] |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 53 | } |
| 54 | |
| 55 | pdfium_fuzzer("pdf_codec_gif_fuzzer") { |
| 56 | sources = [ |
| 57 | "pdf_codec_gif_fuzzer.cc", |
| 58 | "xfa_codec_fuzzer.h", |
dsinclair | 5a5f251 | 2016-06-06 11:52:30 -0700 | [diff] [blame] | 59 | ] |
| 60 | } |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 61 | |
| 62 | pdfium_fuzzer("pdf_codec_jpeg_fuzzer") { |
| 63 | sources = [ |
| 64 | "pdf_codec_jpeg_fuzzer.cc", |
| 65 | "xfa_codec_fuzzer.h", |
| 66 | ] |
| 67 | } |
| 68 | |
| 69 | pdfium_fuzzer("pdf_codec_png_fuzzer") { |
| 70 | sources = [ |
| 71 | "pdf_codec_png_fuzzer.cc", |
| 72 | "xfa_codec_fuzzer.h", |
| 73 | ] |
| 74 | } |
| 75 | |
| 76 | pdfium_fuzzer("pdf_codec_tiff_fuzzer") { |
dsinclair | 5a5f251 | 2016-06-06 11:52:30 -0700 | [diff] [blame] | 77 | sources = [ |
| 78 | "pdf_codec_tiff_fuzzer.cc", |
| 79 | "xfa_codec_fuzzer.h", |
dsinclair | f7e108b | 2016-06-06 08:48:50 -0700 | [diff] [blame] | 80 | ] |
dsinclair | f7e108b | 2016-06-06 08:48:50 -0700 | [diff] [blame] | 81 | } |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 82 | |
| 83 | pdfium_fuzzer("pdf_css_fuzzer") { |
dsinclair | 756d379 | 2016-06-14 07:34:20 -0700 | [diff] [blame] | 84 | sources = [ |
| 85 | "pdf_css_fuzzer.cc", |
| 86 | ] |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 87 | } |
| 88 | |
| 89 | pdfium_fuzzer("pdf_fm2js_fuzzer") { |
| 90 | sources = [ |
| 91 | "pdf_fm2js_fuzzer.cc", |
dsinclair | 756d379 | 2016-06-14 07:34:20 -0700 | [diff] [blame] | 92 | ] |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 93 | } |
| 94 | |
| 95 | pdfium_fuzzer("pdf_xml_fuzzer") { |
| 96 | sources = [ |
| 97 | "pdf_xml_fuzzer.cc", |
dsinclair | 756d379 | 2016-06-14 07:34:20 -0700 | [diff] [blame] | 98 | ] |
| 99 | } |
Oliver Chang | 238bfb7 | 2016-03-21 10:31:00 -0700 | [diff] [blame] | 100 | } |
| 101 | |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 102 | pdfium_fuzzer("pdf_cmap_fuzzer") { |
kcwu | a177d1c | 2016-09-26 12:09:30 -0700 | [diff] [blame] | 103 | sources = [ |
| 104 | "pdf_cmap_fuzzer.cc", |
| 105 | ] |
kcwu | a177d1c | 2016-09-26 12:09:30 -0700 | [diff] [blame] | 106 | } |
| 107 | |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 108 | pdfium_fuzzer("pdf_codec_fax_fuzzer") { |
kcwu | b1a7134 | 2016-09-19 11:06:32 -0700 | [diff] [blame] | 109 | sources = [ |
| 110 | "pdf_codec_fax_fuzzer.cc", |
| 111 | ] |
kcwu | b1a7134 | 2016-09-19 11:06:32 -0700 | [diff] [blame] | 112 | } |
| 113 | |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 114 | pdfium_fuzzer("pdf_codec_icc_fuzzer") { |
kcwu | da4bd10 | 2016-09-22 10:30:18 -0700 | [diff] [blame] | 115 | sources = [ |
| 116 | "pdf_codec_icc_fuzzer.cc", |
| 117 | ] |
kcwu | da4bd10 | 2016-09-22 10:30:18 -0700 | [diff] [blame] | 118 | } |
| 119 | |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 120 | pdfium_fuzzer("pdf_codec_jbig2_fuzzer") { |
kcwu | ec7a945 | 2016-09-27 14:06:50 -0700 | [diff] [blame] | 121 | sources = [ |
| 122 | "pdf_codec_jbig2_fuzzer.cc", |
| 123 | ] |
kcwu | ec7a945 | 2016-09-27 14:06:50 -0700 | [diff] [blame] | 124 | } |
| 125 | |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 126 | pdfium_fuzzer("pdf_hint_table_fuzzer") { |
thestig | 5b13e1d | 2016-08-19 12:04:05 -0700 | [diff] [blame] | 127 | sources = [ |
| 128 | "pdf_hint_table_fuzzer.cc", |
| 129 | ] |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 130 | } |
| 131 | |
| 132 | pdfium_fuzzer("pdf_jpx_fuzzer") { |
| 133 | sources = [ |
| 134 | "pdf_jpx_fuzzer.cc", |
thestig | 5b13e1d | 2016-08-19 12:04:05 -0700 | [diff] [blame] | 135 | ] |
| 136 | } |
tsepez | 236e47a | 2016-08-22 13:11:21 -0700 | [diff] [blame] | 137 | |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame^] | 138 | pdfium_fuzzer("pdf_psengine_fuzzer") { |
| 139 | sources = [ |
| 140 | "pdf_psengine_fuzzer.cc", |
| 141 | ] |
| 142 | } |
| 143 | |
| 144 | pdfium_fuzzer("pdf_streamparser_fuzzer") { |
tsepez | 236e47a | 2016-08-22 13:11:21 -0700 | [diff] [blame] | 145 | sources = [ |
| 146 | "pdf_streamparser_fuzzer.cc", |
| 147 | ] |
tsepez | 236e47a | 2016-08-22 13:11:21 -0700 | [diff] [blame] | 148 | } |