blob: 20c64d9835466b7f796b57bde7ad762903efd3d8 [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") {
thestig62114cf2016-11-08 12:59:30 -08008 configs = [ "../..: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
thestig62114cf2016-11-08 12:59:30 -080023group("libfuzzer") {
Lei Zhang0acfff32017-05-02 16:40:04 -070024 testonly = true
25 deps = [
26 ":pdf_cmap_fuzzer",
27 ":pdf_codec_a85_fuzzer",
28 ":pdf_codec_fax_fuzzer",
29 ":pdf_codec_icc_fuzzer",
30 ":pdf_codec_jbig2_fuzzer",
31 ":pdf_codec_rle_fuzzer",
Nicolas Pena26853182017-05-17 17:10:36 -040032 ":pdf_font_fuzzer",
Lei Zhang0acfff32017-05-02 16:40:04 -070033 ":pdf_hint_table_fuzzer",
34 ":pdf_jpx_fuzzer",
35 ":pdf_psengine_fuzzer",
36 ":pdf_streamparser_fuzzer",
37 ]
38 if (pdf_enable_xfa) {
39 deps += [
40 ":pdf_cfx_barcode_fuzzer",
41 ":pdf_cfx_saxreader_fuzzer",
42 ":pdf_codec_bmp_fuzzer",
43 ":pdf_codec_gif_fuzzer",
44 ":pdf_codec_jpeg_fuzzer",
45 ":pdf_codec_png_fuzzer",
46 ":pdf_codec_tiff_fuzzer",
47 ":pdf_css_fuzzer",
48 ":pdf_fm2js_fuzzer",
Ryan Harrisonf64a7302017-10-19 16:07:24 -040049 ":pdf_formcalc_fuzzer",
Ryan Harrisonc136b312017-10-19 14:37:06 -040050 ":pdf_lzw_fuzzer",
Lei Zhang0acfff32017-05-02 16:40:04 -070051 ":pdf_xml_fuzzer",
52 ]
53 }
thestig62114cf2016-11-08 12:59:30 -080054}
55
56template("pdfium_fuzzer") {
57 source_set(target_name) {
Dan Sinclair8149ae12017-03-28 12:40:20 -040058 sources = invoker.sources + [ "pdf_fuzzer_init.cc" ]
thestig62114cf2016-11-08 12:59:30 -080059 deps = [
60 "../..:pdfium",
61 ]
Lei Zhang61f2f482017-09-19 15:03:15 -070062 if (defined(invoker.deps)) {
63 deps += invoker.deps
64 }
thestig62114cf2016-11-08 12:59:30 -080065 testonly = true
66 configs -= [ "//build/config/compiler:chromium_code" ]
67 configs += [
68 "//build/config/compiler:no_chromium_code",
69 ":libfuzzer_config",
70 ]
71 }
72}
73
npm9adabf82016-11-07 08:34:09 -080074if (pdf_enable_xfa) {
Tom Sepez5628fd72017-04-27 14:58:53 -070075 pdfium_fuzzer("pdf_cfx_barcode_fuzzer") {
76 sources = [
77 "pdf_cfx_barcode_fuzzer.cc",
78 ]
79 }
80
thestig62114cf2016-11-08 12:59:30 -080081 pdfium_fuzzer("pdf_cfx_saxreader_fuzzer") {
npm9adabf82016-11-07 08:34:09 -080082 sources = [
83 "pdf_cfx_saxreader_fuzzer.cc",
84 ]
npm9adabf82016-11-07 08:34:09 -080085 }
thestig62114cf2016-11-08 12:59:30 -080086
87 pdfium_fuzzer("pdf_codec_bmp_fuzzer") {
npm9adabf82016-11-07 08:34:09 -080088 sources = [
89 "pdf_codec_bmp_fuzzer.cc",
90 "xfa_codec_fuzzer.h",
91 ]
thestig62114cf2016-11-08 12:59:30 -080092 }
93
94 pdfium_fuzzer("pdf_codec_gif_fuzzer") {
95 sources = [
96 "pdf_codec_gif_fuzzer.cc",
97 "xfa_codec_fuzzer.h",
npm9adabf82016-11-07 08:34:09 -080098 ]
99 }
thestig62114cf2016-11-08 12:59:30 -0800100
101 pdfium_fuzzer("pdf_codec_jpeg_fuzzer") {
102 sources = [
103 "pdf_codec_jpeg_fuzzer.cc",
104 "xfa_codec_fuzzer.h",
105 ]
106 }
107
108 pdfium_fuzzer("pdf_codec_png_fuzzer") {
109 sources = [
110 "pdf_codec_png_fuzzer.cc",
111 "xfa_codec_fuzzer.h",
112 ]
113 }
114
115 pdfium_fuzzer("pdf_codec_tiff_fuzzer") {
npm9adabf82016-11-07 08:34:09 -0800116 sources = [
117 "pdf_codec_tiff_fuzzer.cc",
118 "xfa_codec_fuzzer.h",
119 ]
npm9adabf82016-11-07 08:34:09 -0800120 }
thestig62114cf2016-11-08 12:59:30 -0800121
122 pdfium_fuzzer("pdf_css_fuzzer") {
npm9adabf82016-11-07 08:34:09 -0800123 sources = [
124 "pdf_css_fuzzer.cc",
125 ]
thestig62114cf2016-11-08 12:59:30 -0800126 }
127
128 pdfium_fuzzer("pdf_fm2js_fuzzer") {
129 sources = [
130 "pdf_fm2js_fuzzer.cc",
npm9adabf82016-11-07 08:34:09 -0800131 ]
thestig62114cf2016-11-08 12:59:30 -0800132 }
133
Ryan Harrisonf64a7302017-10-19 16:07:24 -0400134 pdfium_fuzzer("pdf_formcalc_fuzzer") {
135 sources = [
136 "pdf_formcalc_fuzzer.cc",
137 ]
138 }
139
Ryan Harrisonc136b312017-10-19 14:37:06 -0400140 pdfium_fuzzer("pdf_lzw_fuzzer") {
141 sources = [
142 "pdf_lzw_fuzzer.cc",
143 ]
144 }
145
thestig62114cf2016-11-08 12:59:30 -0800146 pdfium_fuzzer("pdf_xml_fuzzer") {
147 sources = [
148 "pdf_xml_fuzzer.cc",
thestig470b5fa2016-11-07 06:24:48 -0800149 ]
150 }
151}
152
thestig62114cf2016-11-08 12:59:30 -0800153pdfium_fuzzer("pdf_cmap_fuzzer") {
kcwua177d1c2016-09-26 12:09:30 -0700154 sources = [
155 "pdf_cmap_fuzzer.cc",
156 ]
kcwua177d1c2016-09-26 12:09:30 -0700157}
158
rbpotterdb764702017-01-12 10:31:43 -0800159pdfium_fuzzer("pdf_codec_a85_fuzzer") {
160 sources = [
161 "pdf_codec_a85_fuzzer.cc",
162 ]
163}
164
thestig62114cf2016-11-08 12:59:30 -0800165pdfium_fuzzer("pdf_codec_fax_fuzzer") {
kcwub1a71342016-09-19 11:06:32 -0700166 sources = [
167 "pdf_codec_fax_fuzzer.cc",
168 ]
kcwub1a71342016-09-19 11:06:32 -0700169}
170
thestig62114cf2016-11-08 12:59:30 -0800171pdfium_fuzzer("pdf_codec_icc_fuzzer") {
Lei Zhang61f2f482017-09-19 15:03:15 -0700172 deps = [
173 "../../third_party/:lcms2",
174 ]
kcwuda4bd102016-09-22 10:30:18 -0700175 sources = [
176 "pdf_codec_icc_fuzzer.cc",
177 ]
kcwuda4bd102016-09-22 10:30:18 -0700178}
179
thestig62114cf2016-11-08 12:59:30 -0800180pdfium_fuzzer("pdf_codec_jbig2_fuzzer") {
kcwuec7a9452016-09-27 14:06:50 -0700181 sources = [
182 "pdf_codec_jbig2_fuzzer.cc",
183 ]
thestig470b5fa2016-11-07 06:24:48 -0800184}
185
rbpotterdb764702017-01-12 10:31:43 -0800186pdfium_fuzzer("pdf_codec_rle_fuzzer") {
187 sources = [
188 "pdf_codec_rle_fuzzer.cc",
189 ]
190}
191
Nicolas Pena26853182017-05-17 17:10:36 -0400192pdfium_fuzzer("pdf_font_fuzzer") {
193 sources = [
194 "pdf_font_fuzzer.cc",
195 ]
196}
197
thestig62114cf2016-11-08 12:59:30 -0800198pdfium_fuzzer("pdf_hint_table_fuzzer") {
npm9adabf82016-11-07 08:34:09 -0800199 sources = [
200 "pdf_hint_table_fuzzer.cc",
201 ]
thestig62114cf2016-11-08 12:59:30 -0800202}
203
204pdfium_fuzzer("pdf_jpx_fuzzer") {
205 sources = [
206 "pdf_jpx_fuzzer.cc",
npm9adabf82016-11-07 08:34:09 -0800207 ]
208}
209
thestig62114cf2016-11-08 12:59:30 -0800210pdfium_fuzzer("pdf_psengine_fuzzer") {
211 sources = [
212 "pdf_psengine_fuzzer.cc",
213 ]
214}
215
216pdfium_fuzzer("pdf_streamparser_fuzzer") {
tsepez236e47a2016-08-22 13:11:21 -0700217 sources = [
218 "pdf_streamparser_fuzzer.cc",
219 ]
tsepez236e47a2016-08-22 13:11:21 -0700220}