blob: b64cc386c3a6789743cb6f44acc3104c3ca6927b [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",
32 ":pdf_hint_table_fuzzer",
33 ":pdf_jpx_fuzzer",
34 ":pdf_psengine_fuzzer",
35 ":pdf_streamparser_fuzzer",
36 ]
37 if (pdf_enable_xfa) {
38 deps += [
39 ":pdf_cfx_barcode_fuzzer",
40 ":pdf_cfx_saxreader_fuzzer",
41 ":pdf_codec_bmp_fuzzer",
42 ":pdf_codec_gif_fuzzer",
43 ":pdf_codec_jpeg_fuzzer",
44 ":pdf_codec_png_fuzzer",
45 ":pdf_codec_tiff_fuzzer",
46 ":pdf_css_fuzzer",
47 ":pdf_fm2js_fuzzer",
48 ":pdf_xml_fuzzer",
49 ]
50 }
thestig62114cf2016-11-08 12:59:30 -080051}
52
53template("pdfium_fuzzer") {
54 source_set(target_name) {
Dan Sinclair8149ae12017-03-28 12:40:20 -040055 sources = invoker.sources + [ "pdf_fuzzer_init.cc" ]
thestig62114cf2016-11-08 12:59:30 -080056 deps = [
57 "../..:pdfium",
58 ]
59 testonly = true
60 configs -= [ "//build/config/compiler:chromium_code" ]
61 configs += [
62 "//build/config/compiler:no_chromium_code",
63 ":libfuzzer_config",
64 ]
65 }
66}
67
npm9adabf82016-11-07 08:34:09 -080068if (pdf_enable_xfa) {
Tom Sepez5628fd72017-04-27 14:58:53 -070069 pdfium_fuzzer("pdf_cfx_barcode_fuzzer") {
70 sources = [
71 "pdf_cfx_barcode_fuzzer.cc",
72 ]
73 }
74
thestig62114cf2016-11-08 12:59:30 -080075 pdfium_fuzzer("pdf_cfx_saxreader_fuzzer") {
npm9adabf82016-11-07 08:34:09 -080076 sources = [
77 "pdf_cfx_saxreader_fuzzer.cc",
78 ]
npm9adabf82016-11-07 08:34:09 -080079 }
thestig62114cf2016-11-08 12:59:30 -080080
81 pdfium_fuzzer("pdf_codec_bmp_fuzzer") {
npm9adabf82016-11-07 08:34:09 -080082 sources = [
83 "pdf_codec_bmp_fuzzer.cc",
84 "xfa_codec_fuzzer.h",
85 ]
thestig62114cf2016-11-08 12:59:30 -080086 }
87
88 pdfium_fuzzer("pdf_codec_gif_fuzzer") {
89 sources = [
90 "pdf_codec_gif_fuzzer.cc",
91 "xfa_codec_fuzzer.h",
npm9adabf82016-11-07 08:34:09 -080092 ]
93 }
thestig62114cf2016-11-08 12:59:30 -080094
95 pdfium_fuzzer("pdf_codec_jpeg_fuzzer") {
96 sources = [
97 "pdf_codec_jpeg_fuzzer.cc",
98 "xfa_codec_fuzzer.h",
99 ]
100 }
101
102 pdfium_fuzzer("pdf_codec_png_fuzzer") {
103 sources = [
104 "pdf_codec_png_fuzzer.cc",
105 "xfa_codec_fuzzer.h",
106 ]
107 }
108
109 pdfium_fuzzer("pdf_codec_tiff_fuzzer") {
npm9adabf82016-11-07 08:34:09 -0800110 sources = [
111 "pdf_codec_tiff_fuzzer.cc",
112 "xfa_codec_fuzzer.h",
113 ]
npm9adabf82016-11-07 08:34:09 -0800114 }
thestig62114cf2016-11-08 12:59:30 -0800115
116 pdfium_fuzzer("pdf_css_fuzzer") {
npm9adabf82016-11-07 08:34:09 -0800117 sources = [
118 "pdf_css_fuzzer.cc",
119 ]
thestig62114cf2016-11-08 12:59:30 -0800120 }
121
122 pdfium_fuzzer("pdf_fm2js_fuzzer") {
123 sources = [
124 "pdf_fm2js_fuzzer.cc",
npm9adabf82016-11-07 08:34:09 -0800125 ]
thestig62114cf2016-11-08 12:59:30 -0800126 }
127
128 pdfium_fuzzer("pdf_xml_fuzzer") {
129 sources = [
130 "pdf_xml_fuzzer.cc",
thestig470b5fa2016-11-07 06:24:48 -0800131 ]
132 }
133}
134
thestig62114cf2016-11-08 12:59:30 -0800135pdfium_fuzzer("pdf_cmap_fuzzer") {
kcwua177d1c2016-09-26 12:09:30 -0700136 sources = [
137 "pdf_cmap_fuzzer.cc",
138 ]
kcwua177d1c2016-09-26 12:09:30 -0700139}
140
rbpotterdb764702017-01-12 10:31:43 -0800141pdfium_fuzzer("pdf_codec_a85_fuzzer") {
142 sources = [
143 "pdf_codec_a85_fuzzer.cc",
144 ]
145}
146
thestig62114cf2016-11-08 12:59:30 -0800147pdfium_fuzzer("pdf_codec_fax_fuzzer") {
kcwub1a71342016-09-19 11:06:32 -0700148 sources = [
149 "pdf_codec_fax_fuzzer.cc",
150 ]
kcwub1a71342016-09-19 11:06:32 -0700151}
152
thestig62114cf2016-11-08 12:59:30 -0800153pdfium_fuzzer("pdf_codec_icc_fuzzer") {
kcwuda4bd102016-09-22 10:30:18 -0700154 sources = [
155 "pdf_codec_icc_fuzzer.cc",
156 ]
kcwuda4bd102016-09-22 10:30:18 -0700157}
158
thestig62114cf2016-11-08 12:59:30 -0800159pdfium_fuzzer("pdf_codec_jbig2_fuzzer") {
kcwuec7a9452016-09-27 14:06:50 -0700160 sources = [
161 "pdf_codec_jbig2_fuzzer.cc",
162 ]
thestig470b5fa2016-11-07 06:24:48 -0800163}
164
rbpotterdb764702017-01-12 10:31:43 -0800165pdfium_fuzzer("pdf_codec_rle_fuzzer") {
166 sources = [
167 "pdf_codec_rle_fuzzer.cc",
168 ]
169}
170
thestig62114cf2016-11-08 12:59:30 -0800171pdfium_fuzzer("pdf_hint_table_fuzzer") {
npm9adabf82016-11-07 08:34:09 -0800172 sources = [
173 "pdf_hint_table_fuzzer.cc",
174 ]
thestig62114cf2016-11-08 12:59:30 -0800175}
176
177pdfium_fuzzer("pdf_jpx_fuzzer") {
178 sources = [
179 "pdf_jpx_fuzzer.cc",
npm9adabf82016-11-07 08:34:09 -0800180 ]
181}
182
thestig62114cf2016-11-08 12:59:30 -0800183pdfium_fuzzer("pdf_psengine_fuzzer") {
184 sources = [
185 "pdf_psengine_fuzzer.cc",
186 ]
187}
188
189pdfium_fuzzer("pdf_streamparser_fuzzer") {
tsepez236e47a2016-08-22 13:11:21 -0700190 sources = [
191 "pdf_streamparser_fuzzer.cc",
192 ]
tsepez236e47a2016-08-22 13:11:21 -0700193}