blob: e89918b05f8c0a097b583fe7f6e04a4e28722a4f [file] [log] [blame]
Oliver Change67d2182016-02-16 11:42:07 -08001# 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
dsinclair038bf0b2016-04-30 06:00:05 -07005import("../../pdfium.gni")
Oliver Change67d2182016-02-16 11:42:07 -08006
7config("libfuzzer_config") {
npm9adabf82016-11-07 08:34:09 -08008 configs = [ "//third_party/pdfium:pdfium_core_config" ]
dsinclair756d3792016-06-14 07:34:20 -07009
Oliver Change67d2182016-02-16 11:42:07 -080010 defines = [
11 "PNG_PREFIX",
Oliver Change67d2182016-02-16 11:42:07 -080012 "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
npm9adabf82016-11-07 08:34:09 -080023if (pdf_enable_xfa) {
24 source_set("pdf_fm2js_fuzzer") {
thestig470b5fa2016-11-07 06:24:48 -080025 testonly = true
npm9adabf82016-11-07 08:34:09 -080026 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 ]
thestig470b5fa2016-11-07 06:24:48 -0800149 configs -= [ "//build/config/compiler:chromium_code" ]
150 configs += [
151 "//build/config/compiler:no_chromium_code",
152 ":libfuzzer_config",
153 ]
154 }
155}
156
npm9adabf82016-11-07 08:34:09 -0800157source_set("pdf_cmap_fuzzer") {
158 testonly = true
kcwua177d1c2016-09-26 12:09:30 -0700159 sources = [
160 "pdf_cmap_fuzzer.cc",
161 ]
npm9adabf82016-11-07 08:34:09 -0800162 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 ]
kcwua177d1c2016-09-26 12:09:30 -0700170}
171
npm9adabf82016-11-07 08:34:09 -0800172source_set("pdf_codec_fax_fuzzer") {
173 testonly = true
kcwub1a71342016-09-19 11:06:32 -0700174 sources = [
175 "pdf_codec_fax_fuzzer.cc",
176 ]
npm9adabf82016-11-07 08:34:09 -0800177 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 ]
kcwub1a71342016-09-19 11:06:32 -0700185}
186
npm9adabf82016-11-07 08:34:09 -0800187source_set("pdf_codec_icc_fuzzer") {
188 testonly = true
kcwuda4bd102016-09-22 10:30:18 -0700189 sources = [
190 "pdf_codec_icc_fuzzer.cc",
191 ]
npm9adabf82016-11-07 08:34:09 -0800192 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 ]
kcwuda4bd102016-09-22 10:30:18 -0700200}
201
npm9adabf82016-11-07 08:34:09 -0800202source_set("pdf_codec_jbig2_fuzzer") {
203 testonly = true
kcwuec7a9452016-09-27 14:06:50 -0700204 sources = [
205 "pdf_codec_jbig2_fuzzer.cc",
206 ]
npm9adabf82016-11-07 08:34:09 -0800207 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",
thestig5b13e1d2016-08-19 12:04:05 -0700214 ]
thestig470b5fa2016-11-07 06:24:48 -0800215}
216
npm9adabf82016-11-07 08:34:09 -0800217source_set("pdf_jpx_fuzzer") {
218 testonly = true
thestig470b5fa2016-11-07 06:24:48 -0800219 sources = [
220 "pdf_jpx_fuzzer.cc",
thestig5b13e1d2016-08-19 12:04:05 -0700221 ]
npm9adabf82016-11-07 08:34:09 -0800222 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",
thestig470b5fa2016-11-07 06:24:48 -0800229 ]
230}
231
npm9adabf82016-11-07 08:34:09 -0800232source_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
247source_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
262source_set("pdf_streamparser_fuzzer") {
263 testonly = true
tsepez236e47a2016-08-22 13:11:21 -0700264 sources = [
265 "pdf_streamparser_fuzzer.cc",
266 ]
npm9adabf82016-11-07 08:34:09 -0800267 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 ]
tsepez236e47a2016-08-22 13:11:21 -0700275}