blob: 2b9915d3223a3b36a23dac1ab1d7eb475f4de786 [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") {
thestig470b5fa2016-11-07 06:24:48 -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
thestig470b5fa2016-11-07 06:24:48 -080023group("libfuzzer") {
24}
25
26template("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
Oliver Change67d2182016-02-16 11:42:07 -080041if (pdf_enable_xfa) {
thestig470b5fa2016-11-07 06:24:48 -080042 pdfium_fuzzer("pdf_cfx_saxreader_fuzzer") {
dsinclair53772672016-06-16 07:40:47 -070043 sources = [
44 "pdf_cfx_saxreader_fuzzer.cc",
45 ]
dsinclair53772672016-06-16 07:40:47 -070046 }
thestig470b5fa2016-11-07 06:24:48 -080047
48 pdfium_fuzzer("pdf_codec_bmp_fuzzer") {
dsinclair5a5f2512016-06-06 11:52:30 -070049 sources = [
50 "pdf_codec_bmp_fuzzer.cc",
51 "xfa_codec_fuzzer.h",
52 ]
thestig470b5fa2016-11-07 06:24:48 -080053 }
54
55 pdfium_fuzzer("pdf_codec_gif_fuzzer") {
56 sources = [
57 "pdf_codec_gif_fuzzer.cc",
58 "xfa_codec_fuzzer.h",
dsinclair5a5f2512016-06-06 11:52:30 -070059 ]
60 }
thestig470b5fa2016-11-07 06:24:48 -080061
62 pdfium_fuzzer("pdf_codec_jpeg_fuzzer") {
63 sources = [
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") {
dsinclair5a5f2512016-06-06 11:52:30 -070077 sources = [
78 "pdf_codec_tiff_fuzzer.cc",
79 "xfa_codec_fuzzer.h",
dsinclairf7e108b2016-06-06 08:48:50 -070080 ]
dsinclairf7e108b2016-06-06 08:48:50 -070081 }
thestig470b5fa2016-11-07 06:24:48 -080082
83 pdfium_fuzzer("pdf_css_fuzzer") {
dsinclair756d3792016-06-14 07:34:20 -070084 sources = [
85 "pdf_css_fuzzer.cc",
86 ]
thestig470b5fa2016-11-07 06:24:48 -080087 }
88
89 pdfium_fuzzer("pdf_fm2js_fuzzer") {
90 sources = [
91 "pdf_fm2js_fuzzer.cc",
dsinclair756d3792016-06-14 07:34:20 -070092 ]
thestig470b5fa2016-11-07 06:24:48 -080093 }
94
95 pdfium_fuzzer("pdf_xml_fuzzer") {
96 sources = [
97 "pdf_xml_fuzzer.cc",
dsinclair756d3792016-06-14 07:34:20 -070098 ]
99 }
Oliver Chang238bfb72016-03-21 10:31:00 -0700100}
101
thestig470b5fa2016-11-07 06:24:48 -0800102pdfium_fuzzer("pdf_cmap_fuzzer") {
kcwua177d1c2016-09-26 12:09:30 -0700103 sources = [
104 "pdf_cmap_fuzzer.cc",
105 ]
kcwua177d1c2016-09-26 12:09:30 -0700106}
107
thestig470b5fa2016-11-07 06:24:48 -0800108pdfium_fuzzer("pdf_codec_fax_fuzzer") {
kcwub1a71342016-09-19 11:06:32 -0700109 sources = [
110 "pdf_codec_fax_fuzzer.cc",
111 ]
kcwub1a71342016-09-19 11:06:32 -0700112}
113
thestig470b5fa2016-11-07 06:24:48 -0800114pdfium_fuzzer("pdf_codec_icc_fuzzer") {
kcwuda4bd102016-09-22 10:30:18 -0700115 sources = [
116 "pdf_codec_icc_fuzzer.cc",
117 ]
kcwuda4bd102016-09-22 10:30:18 -0700118}
119
thestig470b5fa2016-11-07 06:24:48 -0800120pdfium_fuzzer("pdf_codec_jbig2_fuzzer") {
kcwuec7a9452016-09-27 14:06:50 -0700121 sources = [
122 "pdf_codec_jbig2_fuzzer.cc",
123 ]
kcwuec7a9452016-09-27 14:06:50 -0700124}
125
thestig470b5fa2016-11-07 06:24:48 -0800126pdfium_fuzzer("pdf_hint_table_fuzzer") {
thestig5b13e1d2016-08-19 12:04:05 -0700127 sources = [
128 "pdf_hint_table_fuzzer.cc",
129 ]
thestig470b5fa2016-11-07 06:24:48 -0800130}
131
132pdfium_fuzzer("pdf_jpx_fuzzer") {
133 sources = [
134 "pdf_jpx_fuzzer.cc",
thestig5b13e1d2016-08-19 12:04:05 -0700135 ]
136}
tsepez236e47a2016-08-22 13:11:21 -0700137
thestig470b5fa2016-11-07 06:24:48 -0800138pdfium_fuzzer("pdf_psengine_fuzzer") {
139 sources = [
140 "pdf_psengine_fuzzer.cc",
141 ]
142}
143
144pdfium_fuzzer("pdf_streamparser_fuzzer") {
tsepez236e47a2016-08-22 13:11:21 -0700145 sources = [
146 "pdf_streamparser_fuzzer.cc",
147 ]
tsepez236e47a2016-08-22 13:11:21 -0700148}