OLD | NEW |
1 # Copyright 2016 The PDFium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("../../pdfium.gni") | 5 import("../../pdfium.gni") |
6 | 6 |
7 config("libfuzzer_config") { | 7 config("libfuzzer_config") { |
8 configs = [ "../..:pdfium_core_config" ] | 8 configs = [ "//third_party/pdfium:pdfium_core_config" ] |
9 | 9 |
10 defines = [ | 10 defines = [ |
11 "PNG_PREFIX", | 11 "PNG_PREFIX", |
12 "PNG_USE_READ_MACROS", | 12 "PNG_USE_READ_MACROS", |
13 ] | 13 ] |
14 include_dirs = [ "../.." ] | 14 include_dirs = [ "../.." ] |
15 if (pdf_enable_v8) { | 15 if (pdf_enable_v8) { |
16 defines += [ "PDF_ENABLE_V8" ] | 16 defines += [ "PDF_ENABLE_V8" ] |
17 } | 17 } |
18 if (pdf_enable_xfa) { | 18 if (pdf_enable_xfa) { |
19 defines += [ "PDF_ENABLE_XFA" ] | 19 defines += [ "PDF_ENABLE_XFA" ] |
20 } | 20 } |
21 } | 21 } |
22 | 22 |
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 | |
41 if (pdf_enable_xfa) { | 23 if (pdf_enable_xfa) { |
42 pdfium_fuzzer("pdf_cfx_saxreader_fuzzer") { | 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 } |
| 52 source_set("pdf_cfx_saxreader_fuzzer") { |
| 53 testonly = true |
43 sources = [ | 54 sources = [ |
44 "pdf_cfx_saxreader_fuzzer.cc", | 55 "pdf_cfx_saxreader_fuzzer.cc", |
45 ] | 56 ] |
46 } | 57 deps = [ |
47 | 58 "//third_party/pdfium:pdfium", |
48 pdfium_fuzzer("pdf_codec_bmp_fuzzer") { | 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 |
49 sources = [ | 113 sources = [ |
50 "pdf_codec_bmp_fuzzer.cc", | 114 "pdf_codec_bmp_fuzzer.cc", |
51 "xfa_codec_fuzzer.h", | 115 "xfa_codec_fuzzer.h", |
52 ] | 116 ] |
53 } | 117 deps = [ |
54 | 118 "//third_party/pdfium:pdfium", |
55 pdfium_fuzzer("pdf_codec_gif_fuzzer") { | 119 ] |
56 sources = [ | 120 configs -= [ "//build/config/compiler:chromium_code" ] |
57 "pdf_codec_gif_fuzzer.cc", | 121 configs += [ |
58 "xfa_codec_fuzzer.h", | 122 "//build/config/compiler:no_chromium_code", |
59 ] | 123 ":libfuzzer_config", |
60 } | 124 ] |
61 | 125 } |
62 pdfium_fuzzer("pdf_codec_jpeg_fuzzer") { | 126 source_set("pdf_codec_tiff_fuzzer") { |
63 sources = [ | 127 testonly = true |
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") { | |
77 sources = [ | 128 sources = [ |
78 "pdf_codec_tiff_fuzzer.cc", | 129 "pdf_codec_tiff_fuzzer.cc", |
79 "xfa_codec_fuzzer.h", | 130 "xfa_codec_fuzzer.h", |
80 ] | 131 ] |
81 } | 132 deps = [ |
82 | 133 "//third_party/pdfium:pdfium", |
83 pdfium_fuzzer("pdf_css_fuzzer") { | 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 |
84 sources = [ | 143 sources = [ |
85 "pdf_css_fuzzer.cc", | 144 "pdf_css_fuzzer.cc", |
86 ] | 145 ] |
87 } | 146 deps = [ |
88 | 147 "//third_party/pdfium:pdfium", |
89 pdfium_fuzzer("pdf_fm2js_fuzzer") { | 148 ] |
90 sources = [ | 149 configs -= [ "//build/config/compiler:chromium_code" ] |
91 "pdf_fm2js_fuzzer.cc", | 150 configs += [ |
92 ] | 151 "//build/config/compiler:no_chromium_code", |
93 } | 152 ":libfuzzer_config", |
94 | 153 ] |
95 pdfium_fuzzer("pdf_xml_fuzzer") { | 154 } |
96 sources = [ | 155 } |
97 "pdf_xml_fuzzer.cc", | 156 |
98 ] | 157 source_set("pdf_cmap_fuzzer") { |
99 } | 158 testonly = true |
100 } | |
101 | |
102 pdfium_fuzzer("pdf_cmap_fuzzer") { | |
103 sources = [ | 159 sources = [ |
104 "pdf_cmap_fuzzer.cc", | 160 "pdf_cmap_fuzzer.cc", |
105 ] | 161 ] |
106 } | 162 deps = [ |
107 | 163 "//third_party/pdfium:pdfium", |
108 pdfium_fuzzer("pdf_codec_fax_fuzzer") { | 164 ] |
| 165 configs -= [ "//build/config/compiler:chromium_code" ] |
| 166 configs += [ |
| 167 "//build/config/compiler:no_chromium_code", |
| 168 ":libfuzzer_config", |
| 169 ] |
| 170 } |
| 171 |
| 172 source_set("pdf_codec_fax_fuzzer") { |
| 173 testonly = true |
109 sources = [ | 174 sources = [ |
110 "pdf_codec_fax_fuzzer.cc", | 175 "pdf_codec_fax_fuzzer.cc", |
111 ] | 176 ] |
112 } | 177 deps = [ |
113 | 178 "//third_party/pdfium:pdfium", |
114 pdfium_fuzzer("pdf_codec_icc_fuzzer") { | 179 ] |
| 180 configs -= [ "//build/config/compiler:chromium_code" ] |
| 181 configs += [ |
| 182 "//build/config/compiler:no_chromium_code", |
| 183 ":libfuzzer_config", |
| 184 ] |
| 185 } |
| 186 |
| 187 source_set("pdf_codec_icc_fuzzer") { |
| 188 testonly = true |
115 sources = [ | 189 sources = [ |
116 "pdf_codec_icc_fuzzer.cc", | 190 "pdf_codec_icc_fuzzer.cc", |
117 ] | 191 ] |
118 } | 192 deps = [ |
119 | 193 "//third_party/pdfium:pdfium", |
120 pdfium_fuzzer("pdf_codec_jbig2_fuzzer") { | 194 ] |
| 195 configs -= [ "//build/config/compiler:chromium_code" ] |
| 196 configs += [ |
| 197 "//build/config/compiler:no_chromium_code", |
| 198 ":libfuzzer_config", |
| 199 ] |
| 200 } |
| 201 |
| 202 source_set("pdf_codec_jbig2_fuzzer") { |
| 203 testonly = true |
121 sources = [ | 204 sources = [ |
122 "pdf_codec_jbig2_fuzzer.cc", | 205 "pdf_codec_jbig2_fuzzer.cc", |
123 ] | 206 ] |
124 } | 207 deps = [ |
125 | 208 "//third_party/pdfium:pdfium", |
126 pdfium_fuzzer("pdf_hint_table_fuzzer") { | 209 ] |
| 210 configs -= [ "//build/config/compiler:chromium_code" ] |
| 211 configs += [ |
| 212 "//build/config/compiler:no_chromium_code", |
| 213 ":libfuzzer_config", |
| 214 ] |
| 215 } |
| 216 |
| 217 source_set("pdf_jpx_fuzzer") { |
| 218 testonly = true |
| 219 sources = [ |
| 220 "pdf_jpx_fuzzer.cc", |
| 221 ] |
| 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", |
| 229 ] |
| 230 } |
| 231 |
| 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 |
127 sources = [ | 249 sources = [ |
128 "pdf_hint_table_fuzzer.cc", | 250 "pdf_hint_table_fuzzer.cc", |
129 ] | 251 ] |
130 } | 252 deps = [ |
131 | 253 "//third_party/pdfium:pdfium", |
132 pdfium_fuzzer("pdf_jpx_fuzzer") { | 254 ] |
133 sources = [ | 255 configs -= [ "//build/config/compiler:chromium_code" ] |
134 "pdf_jpx_fuzzer.cc", | 256 configs += [ |
135 ] | 257 "//build/config/compiler:no_chromium_code", |
136 } | 258 ":libfuzzer_config", |
137 | 259 ] |
138 pdfium_fuzzer("pdf_psengine_fuzzer") { | 260 } |
139 sources = [ | 261 |
140 "pdf_psengine_fuzzer.cc", | 262 source_set("pdf_streamparser_fuzzer") { |
141 ] | 263 testonly = true |
142 } | |
143 | |
144 pdfium_fuzzer("pdf_streamparser_fuzzer") { | |
145 sources = [ | 264 sources = [ |
146 "pdf_streamparser_fuzzer.cc", | 265 "pdf_streamparser_fuzzer.cc", |
147 ] | 266 ] |
148 } | 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 ] |
| 275 } |
OLD | NEW |