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") { |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 8 | configs = [ "//third_party/pdfium: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 | |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 23 | if (pdf_enable_xfa) { |
| 24 | source_set("pdf_fm2js_fuzzer") { |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame] | 25 | testonly = true |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 26 | sources = [ |
| 27 | "pdf_fm2js_fuzzer.cc", |
| 28 | ] |
| 29 | deps = [ |
| 30 | "//third_party/pdfium:pdfium", |
| 31 | ] |
| 32 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 33 | configs += [ |
| 34 | "//build/config/compiler:no_chromium_code", |
| 35 | ":libfuzzer_config", |
| 36 | ] |
| 37 | } |
| 38 | source_set("pdf_xml_fuzzer") { |
| 39 | testonly = true |
| 40 | sources = [ |
| 41 | "pdf_xml_fuzzer.cc", |
| 42 | ] |
| 43 | deps = [ |
| 44 | "//third_party/pdfium:pdfium", |
| 45 | ] |
| 46 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 47 | configs += [ |
| 48 | "//build/config/compiler:no_chromium_code", |
| 49 | ":libfuzzer_config", |
| 50 | ] |
| 51 | } |
| 52 | source_set("pdf_cfx_saxreader_fuzzer") { |
| 53 | testonly = true |
| 54 | sources = [ |
| 55 | "pdf_cfx_saxreader_fuzzer.cc", |
| 56 | ] |
| 57 | deps = [ |
| 58 | "//third_party/pdfium:pdfium", |
| 59 | ] |
| 60 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 61 | configs += [ |
| 62 | "//build/config/compiler:no_chromium_code", |
| 63 | ":libfuzzer_config", |
| 64 | ] |
| 65 | } |
| 66 | source_set("pdf_codec_png_fuzzer") { |
| 67 | testonly = true |
| 68 | sources = [ |
| 69 | "pdf_codec_png_fuzzer.cc", |
| 70 | "xfa_codec_fuzzer.h", |
| 71 | ] |
| 72 | deps = [ |
| 73 | "//third_party/pdfium:pdfium", |
| 74 | ] |
| 75 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 76 | configs += [ |
| 77 | "//build/config/compiler:no_chromium_code", |
| 78 | ":libfuzzer_config", |
| 79 | ] |
| 80 | } |
| 81 | source_set("pdf_codec_jpeg_fuzzer") { |
| 82 | testonly = true |
| 83 | sources = [ |
| 84 | "pdf_codec_jpeg_fuzzer.cc", |
| 85 | "xfa_codec_fuzzer.h", |
| 86 | ] |
| 87 | deps = [ |
| 88 | "//third_party/pdfium:pdfium", |
| 89 | ] |
| 90 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 91 | configs += [ |
| 92 | "//build/config/compiler:no_chromium_code", |
| 93 | ":libfuzzer_config", |
| 94 | ] |
| 95 | } |
| 96 | source_set("pdf_codec_gif_fuzzer") { |
| 97 | testonly = true |
| 98 | sources = [ |
| 99 | "pdf_codec_gif_fuzzer.cc", |
| 100 | "xfa_codec_fuzzer.h", |
| 101 | ] |
| 102 | deps = [ |
| 103 | "//third_party/pdfium:pdfium", |
| 104 | ] |
| 105 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 106 | configs += [ |
| 107 | "//build/config/compiler:no_chromium_code", |
| 108 | ":libfuzzer_config", |
| 109 | ] |
| 110 | } |
| 111 | source_set("pdf_codec_bmp_fuzzer") { |
| 112 | testonly = true |
| 113 | sources = [ |
| 114 | "pdf_codec_bmp_fuzzer.cc", |
| 115 | "xfa_codec_fuzzer.h", |
| 116 | ] |
| 117 | deps = [ |
| 118 | "//third_party/pdfium:pdfium", |
| 119 | ] |
| 120 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 121 | configs += [ |
| 122 | "//build/config/compiler:no_chromium_code", |
| 123 | ":libfuzzer_config", |
| 124 | ] |
| 125 | } |
| 126 | source_set("pdf_codec_tiff_fuzzer") { |
| 127 | testonly = true |
| 128 | sources = [ |
| 129 | "pdf_codec_tiff_fuzzer.cc", |
| 130 | "xfa_codec_fuzzer.h", |
| 131 | ] |
| 132 | deps = [ |
| 133 | "//third_party/pdfium:pdfium", |
| 134 | ] |
| 135 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 136 | configs += [ |
| 137 | "//build/config/compiler:no_chromium_code", |
| 138 | ":libfuzzer_config", |
| 139 | ] |
| 140 | } |
| 141 | source_set("pdf_css_fuzzer") { |
| 142 | testonly = true |
| 143 | sources = [ |
| 144 | "pdf_css_fuzzer.cc", |
| 145 | ] |
| 146 | deps = [ |
| 147 | "//third_party/pdfium:pdfium", |
| 148 | ] |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame] | 149 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 150 | configs += [ |
| 151 | "//build/config/compiler:no_chromium_code", |
| 152 | ":libfuzzer_config", |
| 153 | ] |
| 154 | } |
| 155 | } |
| 156 | |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 157 | source_set("pdf_cmap_fuzzer") { |
| 158 | testonly = true |
kcwu | a177d1c | 2016-09-26 12:09:30 -0700 | [diff] [blame] | 159 | sources = [ |
| 160 | "pdf_cmap_fuzzer.cc", |
| 161 | ] |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 162 | deps = [ |
| 163 | "//third_party/pdfium:pdfium", |
| 164 | ] |
| 165 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 166 | configs += [ |
| 167 | "//build/config/compiler:no_chromium_code", |
| 168 | ":libfuzzer_config", |
| 169 | ] |
kcwu | a177d1c | 2016-09-26 12:09:30 -0700 | [diff] [blame] | 170 | } |
| 171 | |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 172 | source_set("pdf_codec_fax_fuzzer") { |
| 173 | testonly = true |
kcwu | b1a7134 | 2016-09-19 11:06:32 -0700 | [diff] [blame] | 174 | sources = [ |
| 175 | "pdf_codec_fax_fuzzer.cc", |
| 176 | ] |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 177 | deps = [ |
| 178 | "//third_party/pdfium:pdfium", |
| 179 | ] |
| 180 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 181 | configs += [ |
| 182 | "//build/config/compiler:no_chromium_code", |
| 183 | ":libfuzzer_config", |
| 184 | ] |
kcwu | b1a7134 | 2016-09-19 11:06:32 -0700 | [diff] [blame] | 185 | } |
| 186 | |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 187 | source_set("pdf_codec_icc_fuzzer") { |
| 188 | testonly = true |
kcwu | da4bd10 | 2016-09-22 10:30:18 -0700 | [diff] [blame] | 189 | sources = [ |
| 190 | "pdf_codec_icc_fuzzer.cc", |
| 191 | ] |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 192 | deps = [ |
| 193 | "//third_party/pdfium:pdfium", |
| 194 | ] |
| 195 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 196 | configs += [ |
| 197 | "//build/config/compiler:no_chromium_code", |
| 198 | ":libfuzzer_config", |
| 199 | ] |
kcwu | da4bd10 | 2016-09-22 10:30:18 -0700 | [diff] [blame] | 200 | } |
| 201 | |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 202 | source_set("pdf_codec_jbig2_fuzzer") { |
| 203 | testonly = true |
kcwu | ec7a945 | 2016-09-27 14:06:50 -0700 | [diff] [blame] | 204 | sources = [ |
| 205 | "pdf_codec_jbig2_fuzzer.cc", |
| 206 | ] |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 207 | deps = [ |
| 208 | "//third_party/pdfium:pdfium", |
| 209 | ] |
| 210 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 211 | configs += [ |
| 212 | "//build/config/compiler:no_chromium_code", |
| 213 | ":libfuzzer_config", |
thestig | 5b13e1d | 2016-08-19 12:04:05 -0700 | [diff] [blame] | 214 | ] |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame] | 215 | } |
| 216 | |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 217 | source_set("pdf_jpx_fuzzer") { |
| 218 | testonly = true |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame] | 219 | sources = [ |
| 220 | "pdf_jpx_fuzzer.cc", |
thestig | 5b13e1d | 2016-08-19 12:04:05 -0700 | [diff] [blame] | 221 | ] |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 222 | deps = [ |
| 223 | "//third_party/pdfium:pdfium", |
| 224 | ] |
| 225 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 226 | configs += [ |
| 227 | "//build/config/compiler:no_chromium_code", |
| 228 | ":libfuzzer_config", |
thestig | 470b5fa | 2016-11-07 06:24:48 -0800 | [diff] [blame] | 229 | ] |
| 230 | } |
| 231 | |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 232 | source_set("pdf_psengine_fuzzer") { |
| 233 | testonly = true |
| 234 | sources = [ |
| 235 | "pdf_psengine_fuzzer.cc", |
| 236 | ] |
| 237 | deps = [ |
| 238 | "//third_party/pdfium:pdfium", |
| 239 | ] |
| 240 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 241 | configs += [ |
| 242 | "//build/config/compiler:no_chromium_code", |
| 243 | ":libfuzzer_config", |
| 244 | ] |
| 245 | } |
| 246 | |
| 247 | source_set("pdf_hint_table_fuzzer") { |
| 248 | testonly = true |
| 249 | sources = [ |
| 250 | "pdf_hint_table_fuzzer.cc", |
| 251 | ] |
| 252 | deps = [ |
| 253 | "//third_party/pdfium:pdfium", |
| 254 | ] |
| 255 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 256 | configs += [ |
| 257 | "//build/config/compiler:no_chromium_code", |
| 258 | ":libfuzzer_config", |
| 259 | ] |
| 260 | } |
| 261 | |
| 262 | source_set("pdf_streamparser_fuzzer") { |
| 263 | testonly = true |
tsepez | 236e47a | 2016-08-22 13:11:21 -0700 | [diff] [blame] | 264 | sources = [ |
| 265 | "pdf_streamparser_fuzzer.cc", |
| 266 | ] |
npm | 9adabf8 | 2016-11-07 08:34:09 -0800 | [diff] [blame^] | 267 | deps = [ |
| 268 | "//third_party/pdfium:pdfium", |
| 269 | ] |
| 270 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 271 | configs += [ |
| 272 | "//build/config/compiler:no_chromium_code", |
| 273 | ":libfuzzer_config", |
| 274 | ] |
tsepez | 236e47a | 2016-08-22 13:11:21 -0700 | [diff] [blame] | 275 | } |