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") { |
dsinclair | 756d379 | 2016-06-14 07:34:20 -0700 | [diff] [blame] | 8 | configs = [ "//third_party/pdfium:pdfium_core_config" ] |
| 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 | |
| 23 | if (pdf_enable_xfa) { |
| 24 | source_set("pdf_fm2js_fuzzer") { |
| 25 | testonly = true |
| 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 | } |
dsinclair | f7e108b | 2016-06-06 08:48:50 -0700 | [diff] [blame] | 52 | source_set("pdf_codec_png_fuzzer") { |
| 53 | testonly = true |
| 54 | sources = [ |
| 55 | "pdf_codec_png_fuzzer.cc", |
dsinclair | 5a5f251 | 2016-06-06 11:52:30 -0700 | [diff] [blame] | 56 | "xfa_codec_fuzzer.h", |
| 57 | ] |
| 58 | deps = [ |
| 59 | "//third_party/pdfium:pdfium", |
| 60 | ] |
| 61 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 62 | configs += [ |
| 63 | "//build/config/compiler:no_chromium_code", |
| 64 | ":libfuzzer_config", |
| 65 | ] |
| 66 | } |
| 67 | source_set("pdf_codec_jpeg_fuzzer") { |
| 68 | testonly = true |
| 69 | sources = [ |
| 70 | "pdf_codec_jpeg_fuzzer.cc", |
| 71 | "xfa_codec_fuzzer.h", |
| 72 | ] |
| 73 | deps = [ |
| 74 | "//third_party/pdfium:pdfium", |
| 75 | ] |
| 76 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 77 | configs += [ |
| 78 | "//build/config/compiler:no_chromium_code", |
| 79 | ":libfuzzer_config", |
| 80 | ] |
| 81 | } |
| 82 | source_set("pdf_codec_gif_fuzzer") { |
| 83 | testonly = true |
| 84 | sources = [ |
| 85 | "pdf_codec_gif_fuzzer.cc", |
| 86 | "xfa_codec_fuzzer.h", |
| 87 | ] |
| 88 | deps = [ |
| 89 | "//third_party/pdfium:pdfium", |
| 90 | ] |
| 91 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 92 | configs += [ |
| 93 | "//build/config/compiler:no_chromium_code", |
| 94 | ":libfuzzer_config", |
| 95 | ] |
| 96 | } |
| 97 | source_set("pdf_codec_bmp_fuzzer") { |
| 98 | testonly = true |
| 99 | sources = [ |
| 100 | "pdf_codec_bmp_fuzzer.cc", |
| 101 | "xfa_codec_fuzzer.h", |
| 102 | ] |
| 103 | deps = [ |
| 104 | "//third_party/pdfium:pdfium", |
| 105 | ] |
| 106 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 107 | configs += [ |
| 108 | "//build/config/compiler:no_chromium_code", |
| 109 | ":libfuzzer_config", |
| 110 | ] |
| 111 | } |
| 112 | source_set("pdf_codec_tiff_fuzzer") { |
| 113 | testonly = true |
| 114 | sources = [ |
| 115 | "pdf_codec_tiff_fuzzer.cc", |
| 116 | "xfa_codec_fuzzer.h", |
dsinclair | f7e108b | 2016-06-06 08:48:50 -0700 | [diff] [blame] | 117 | ] |
| 118 | deps = [ |
| 119 | "//third_party/pdfium:pdfium", |
| 120 | ] |
| 121 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 122 | configs += [ |
| 123 | "//build/config/compiler:no_chromium_code", |
| 124 | ":libfuzzer_config", |
| 125 | ] |
| 126 | } |
dsinclair | 756d379 | 2016-06-14 07:34:20 -0700 | [diff] [blame] | 127 | source_set("pdf_css_fuzzer") { |
| 128 | testonly = true |
| 129 | sources = [ |
| 130 | "pdf_css_fuzzer.cc", |
| 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 | } |
Oliver Chang | 238bfb7 | 2016-03-21 10:31:00 -0700 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | source_set("pdf_jpx_fuzzer") { |
| 144 | testonly = true |
| 145 | sources = [ |
| 146 | "pdf_jpx_fuzzer.cc", |
| 147 | ] |
| 148 | deps = [ |
| 149 | "//third_party/pdfium:pdfium", |
| 150 | ] |
| 151 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 152 | configs += [ |
| 153 | "//build/config/compiler:no_chromium_code", |
| 154 | ":libfuzzer_config", |
| 155 | ] |
Oliver Chang | e67d218 | 2016-02-16 11:42:07 -0800 | [diff] [blame] | 156 | } |