blob: e15ac05cbb9fafd4a92d88c4fa78cd58d76e5ac6 [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") {
24}
25
26template("pdfium_fuzzer") {
27 source_set(target_name) {
Dan Sinclair8149ae12017-03-28 12:40:20 -040028 sources = invoker.sources + [ "pdf_fuzzer_init.cc" ]
thestig62114cf2016-11-08 12:59:30 -080029 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
npm9adabf82016-11-07 08:34:09 -080041if (pdf_enable_xfa) {
Tom Sepez5628fd72017-04-27 14:58:53 -070042 pdfium_fuzzer("pdf_cfx_barcode_fuzzer") {
43 sources = [
44 "pdf_cfx_barcode_fuzzer.cc",
45 ]
46 }
47
thestig62114cf2016-11-08 12:59:30 -080048 pdfium_fuzzer("pdf_cfx_saxreader_fuzzer") {
npm9adabf82016-11-07 08:34:09 -080049 sources = [
50 "pdf_cfx_saxreader_fuzzer.cc",
51 ]
npm9adabf82016-11-07 08:34:09 -080052 }
thestig62114cf2016-11-08 12:59:30 -080053
54 pdfium_fuzzer("pdf_codec_bmp_fuzzer") {
npm9adabf82016-11-07 08:34:09 -080055 sources = [
56 "pdf_codec_bmp_fuzzer.cc",
57 "xfa_codec_fuzzer.h",
58 ]
thestig62114cf2016-11-08 12:59:30 -080059 }
60
61 pdfium_fuzzer("pdf_codec_gif_fuzzer") {
62 sources = [
63 "pdf_codec_gif_fuzzer.cc",
64 "xfa_codec_fuzzer.h",
npm9adabf82016-11-07 08:34:09 -080065 ]
66 }
thestig62114cf2016-11-08 12:59:30 -080067
68 pdfium_fuzzer("pdf_codec_jpeg_fuzzer") {
69 sources = [
70 "pdf_codec_jpeg_fuzzer.cc",
71 "xfa_codec_fuzzer.h",
72 ]
73 }
74
75 pdfium_fuzzer("pdf_codec_png_fuzzer") {
76 sources = [
77 "pdf_codec_png_fuzzer.cc",
78 "xfa_codec_fuzzer.h",
79 ]
80 }
81
82 pdfium_fuzzer("pdf_codec_tiff_fuzzer") {
npm9adabf82016-11-07 08:34:09 -080083 sources = [
84 "pdf_codec_tiff_fuzzer.cc",
85 "xfa_codec_fuzzer.h",
86 ]
npm9adabf82016-11-07 08:34:09 -080087 }
thestig62114cf2016-11-08 12:59:30 -080088
89 pdfium_fuzzer("pdf_css_fuzzer") {
npm9adabf82016-11-07 08:34:09 -080090 sources = [
91 "pdf_css_fuzzer.cc",
92 ]
thestig62114cf2016-11-08 12:59:30 -080093 }
94
95 pdfium_fuzzer("pdf_fm2js_fuzzer") {
96 sources = [
97 "pdf_fm2js_fuzzer.cc",
npm9adabf82016-11-07 08:34:09 -080098 ]
thestig62114cf2016-11-08 12:59:30 -080099 }
100
101 pdfium_fuzzer("pdf_xml_fuzzer") {
102 sources = [
103 "pdf_xml_fuzzer.cc",
thestig470b5fa2016-11-07 06:24:48 -0800104 ]
105 }
106}
107
thestig62114cf2016-11-08 12:59:30 -0800108pdfium_fuzzer("pdf_cmap_fuzzer") {
kcwua177d1c2016-09-26 12:09:30 -0700109 sources = [
110 "pdf_cmap_fuzzer.cc",
111 ]
kcwua177d1c2016-09-26 12:09:30 -0700112}
113
rbpotterdb764702017-01-12 10:31:43 -0800114pdfium_fuzzer("pdf_codec_a85_fuzzer") {
115 sources = [
116 "pdf_codec_a85_fuzzer.cc",
117 ]
118}
119
thestig62114cf2016-11-08 12:59:30 -0800120pdfium_fuzzer("pdf_codec_fax_fuzzer") {
kcwub1a71342016-09-19 11:06:32 -0700121 sources = [
122 "pdf_codec_fax_fuzzer.cc",
123 ]
kcwub1a71342016-09-19 11:06:32 -0700124}
125
thestig62114cf2016-11-08 12:59:30 -0800126pdfium_fuzzer("pdf_codec_icc_fuzzer") {
kcwuda4bd102016-09-22 10:30:18 -0700127 sources = [
128 "pdf_codec_icc_fuzzer.cc",
129 ]
kcwuda4bd102016-09-22 10:30:18 -0700130}
131
thestig62114cf2016-11-08 12:59:30 -0800132pdfium_fuzzer("pdf_codec_jbig2_fuzzer") {
kcwuec7a9452016-09-27 14:06:50 -0700133 sources = [
134 "pdf_codec_jbig2_fuzzer.cc",
135 ]
thestig470b5fa2016-11-07 06:24:48 -0800136}
137
rbpotterdb764702017-01-12 10:31:43 -0800138pdfium_fuzzer("pdf_codec_rle_fuzzer") {
139 sources = [
140 "pdf_codec_rle_fuzzer.cc",
141 ]
142}
143
thestig62114cf2016-11-08 12:59:30 -0800144pdfium_fuzzer("pdf_hint_table_fuzzer") {
npm9adabf82016-11-07 08:34:09 -0800145 sources = [
146 "pdf_hint_table_fuzzer.cc",
147 ]
thestig62114cf2016-11-08 12:59:30 -0800148}
149
150pdfium_fuzzer("pdf_jpx_fuzzer") {
151 sources = [
152 "pdf_jpx_fuzzer.cc",
npm9adabf82016-11-07 08:34:09 -0800153 ]
154}
155
thestig62114cf2016-11-08 12:59:30 -0800156pdfium_fuzzer("pdf_psengine_fuzzer") {
157 sources = [
158 "pdf_psengine_fuzzer.cc",
159 ]
160}
161
162pdfium_fuzzer("pdf_streamparser_fuzzer") {
tsepez236e47a2016-08-22 13:11:21 -0700163 sources = [
164 "pdf_streamparser_fuzzer.cc",
165 ]
tsepez236e47a2016-08-22 13:11:21 -0700166}