blob: 2468dd4e5de8384db685a92d5f7fe8901c322ac8 [file] [log] [blame]
Bo Xu4c764f32014-12-19 14:29:17 -08001# Copyright 2014 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
Tom Sepez465ed872015-12-09 14:55:41 -08005import("../pdfium.gni")
6
Bo Xu4c764f32014-12-19 14:29:17 -08007group("third_party") {
8 deps = [
9 ":bigint",
Tom Sepez0dfd0302015-10-12 15:38:22 -070010 ":fx_freetype",
Tom Sepez35425892015-02-05 10:03:18 -080011 ":pdfium_base",
Bo Xu4c764f32014-12-19 14:29:17 -080012 ]
13}
14
Tom Sepez465ed872015-12-09 14:55:41 -080015source_set("bigint") {
Tom Sepez54172662015-01-09 14:49:47 -080016 configs -= [ "//build/config/compiler:chromium_code" ]
17 configs += [
Tom Sepez6fd997b2015-06-18 17:51:37 -070018 "//build/config/compiler:no_chromium_code",
19 "//third_party/pdfium:pdfium_config",
Tom Sepez54172662015-01-09 14:49:47 -080020 ]
Bo Xu4c764f32014-12-19 14:29:17 -080021 sources = [
Tom Sepez465ed872015-12-09 14:55:41 -080022 "bigint/BigInteger.cc",
Bo Xu4c764f32014-12-19 14:29:17 -080023 "bigint/BigInteger.hh",
24 "bigint/BigIntegerLibrary.hh",
Bo Xu4c764f32014-12-19 14:29:17 -080025 "bigint/BigIntegerUtils.cc",
Tom Sepez465ed872015-12-09 14:55:41 -080026 "bigint/BigIntegerUtils.hh",
Bo Xu4c764f32014-12-19 14:29:17 -080027 "bigint/BigUnsigned.cc",
Tom Sepez465ed872015-12-09 14:55:41 -080028 "bigint/BigUnsigned.hh",
Bo Xu4c764f32014-12-19 14:29:17 -080029 "bigint/BigUnsignedInABase.cc",
Tom Sepez465ed872015-12-09 14:55:41 -080030 "bigint/BigUnsignedInABase.hh",
31 "bigint/NumberlikeArray.hh",
Bo Xu4c764f32014-12-19 14:29:17 -080032 ]
33}
34
Lei Zhang4f9ccbf2015-10-30 13:04:57 -070035config("fx_freetype_warnings") {
36 visibility = [ ":*" ]
37 if (is_clang) {
38 # open_face_PS_from_sfnt_stream() and open_face_from_buffer() in
39 # ftbase.h are unused.
40 cflags = [ "-Wno-unused-function" ]
41 }
42}
43
Tom Sepez465ed872015-12-09 14:55:41 -080044# Tests may link against this even if the production library doesn't,
45# so it needs to be separate from it.
46static_library("fx_freetype") {
Tom Sepez54172662015-01-09 14:49:47 -080047 configs -= [ "//build/config/compiler:chromium_code" ]
48 configs += [
Tom Sepez6fd997b2015-06-18 17:51:37 -070049 "//build/config/compiler:no_chromium_code",
50 "//third_party/pdfium:pdfium_config",
Lei Zhang8241df72015-11-06 14:38:48 -080051
Lei Zhang4f9ccbf2015-10-30 13:04:57 -070052 # Must be after no_chromium_code for warning flags to be ordered correctly.
53 ":fx_freetype_warnings",
Bo Xu4c764f32014-12-19 14:29:17 -080054 ]
John Abd-El-Malekef4dce42015-02-02 16:52:07 -080055 defines = [ "FT2_BUILD_LIBRARY" ]
Bo Xu4c764f32014-12-19 14:29:17 -080056 sources = [
Oliver Changcec3f682015-11-05 16:00:40 -080057 "freetype/include/freetype/freetype.h",
58 "freetype/include/freetype/ftmm.h",
59 "freetype/include/freetype/ftotval.h",
60 "freetype/include/freetype/ftoutln.h",
61 "freetype/include/freetype/internal/ftobjs.h",
62 "freetype/include/freetype/internal/ftstream.h",
63 "freetype/include/freetype/internal/tttypes.h",
64 "freetype/include/freetype/tttables.h",
Bo Xu4c764f32014-12-19 14:29:17 -080065 "freetype/include/ft2build.h",
Bo Xu4c764f32014-12-19 14:29:17 -080066 "freetype/src/base/ftbase.c",
Oliver Changcec3f682015-11-05 16:00:40 -080067 "freetype/src/base/ftbase.h",
Bo Xu4c764f32014-12-19 14:29:17 -080068 "freetype/src/base/ftbitmap.c",
69 "freetype/src/base/ftglyph.c",
70 "freetype/src/base/ftinit.c",
71 "freetype/src/base/ftlcdfil.c",
72 "freetype/src/base/ftmm.c",
73 "freetype/src/base/ftsystem.c",
Oliver Changcec3f682015-11-05 16:00:40 -080074 "freetype/src/cff/cff.c",
75 "freetype/src/cff/cffobjs.h",
76 "freetype/src/cff/cfftypes.h",
77 "freetype/src/cid/type1cid.c",
Bo Xu4c764f32014-12-19 14:29:17 -080078 "freetype/src/psaux/psaux.c",
79 "freetype/src/pshinter/pshinter.c",
80 "freetype/src/psnames/psmodule.c",
81 "freetype/src/raster/raster.c",
82 "freetype/src/sfnt/sfnt.c",
83 "freetype/src/smooth/smooth.c",
84 "freetype/src/truetype/truetype.c",
85 "freetype/src/type1/type1.c",
Bo Xu4c764f32014-12-19 14:29:17 -080086 ]
87}
88
Lei Zhang4f9ccbf2015-10-30 13:04:57 -070089config("fx_agg_warnings") {
90 visibility = [ ":*" ]
91 if (is_clang) {
92 # calc_butt_cap() in agg_vcgen_stroke.cpp is unused.
93 cflags = [ "-Wno-unused-function" ]
94 }
95}
96
Tom Sepez8be55752015-06-17 11:05:02 -070097source_set("fx_agg") {
98 configs -= [ "//build/config/compiler:chromium_code" ]
99 configs += [
100 "//build/config/compiler:no_chromium_code",
101 "//third_party/pdfium:pdfium_config",
Lei Zhang8241df72015-11-06 14:38:48 -0800102
Lei Zhang4f9ccbf2015-10-30 13:04:57 -0700103 # Must be after no_chromium_code for warning flags to be ordered correctly.
104 ":fx_agg_warnings",
Tom Sepez8be55752015-06-17 11:05:02 -0700105 ]
106 sources = [
107 "agg23/agg_basics.h",
108 "agg23/agg_clip_liang_barsky.h",
109 "agg23/agg_conv_dash.h",
110 "agg23/agg_conv_stroke.h",
111 "agg23/agg_curves.cpp",
112 "agg23/agg_curves.h",
113 "agg23/agg_path_storage.cpp",
114 "agg23/agg_path_storage.h",
115 "agg23/agg_rasterizer_scanline_aa.cpp",
116 "agg23/agg_rasterizer_scanline_aa.h",
117 "agg23/agg_renderer_scanline.h",
118 "agg23/agg_rendering_buffer.h",
119 "agg23/agg_scanline_u.h",
120 "agg23/agg_vcgen_dash.cpp",
121 "agg23/agg_vcgen_stroke.cpp",
122 ]
123}
124
Lei Zhange262c9a2015-09-03 16:16:10 -0700125config("fx_lcms2_warnings") {
Tom Sepez465ed872015-12-09 14:55:41 -0800126 visibility = [ ":*" ]
Lei Zhange262c9a2015-09-03 16:16:10 -0700127 if (is_clang) {
Lei Zhang8241df72015-11-06 14:38:48 -0800128 cflags = [
129 # cmslut.cc is sloppy with aggregate initialization. Version 2.7 of this
130 # library doesn't appear to have this problem.
131 "-Wno-missing-braces",
132
133 # FindPrev() in cmsplugin.c is unused.
134 "-Wno-unused-function",
135 ]
Nico Weber2827bdd2015-07-01 14:08:08 -0700136 }
Lei Zhange262c9a2015-09-03 16:16:10 -0700137}
138
139source_set("fx_lcms2") {
Tom Sepez8be55752015-06-17 11:05:02 -0700140 configs -= [ "//build/config/compiler:chromium_code" ]
141 configs += [
142 "//build/config/compiler:no_chromium_code",
143 "//third_party/pdfium:pdfium_config",
Lei Zhang8241df72015-11-06 14:38:48 -0800144
Lei Zhang4f9ccbf2015-10-30 13:04:57 -0700145 # Must be after no_chromium_code for warning flags to be ordered correctly.
Nico Weber2827bdd2015-07-01 14:08:08 -0700146 ":fx_lcms2_warnings",
Tom Sepez8be55752015-06-17 11:05:02 -0700147 ]
148 sources = [
149 "lcms2-2.6/include/lcms2.h",
150 "lcms2-2.6/include/lcms2_plugin.h",
151 "lcms2-2.6/src/cmscam02.c",
152 "lcms2-2.6/src/cmscgats.c",
153 "lcms2-2.6/src/cmscnvrt.c",
154 "lcms2-2.6/src/cmserr.c",
155 "lcms2-2.6/src/cmsgamma.c",
156 "lcms2-2.6/src/cmsgmt.c",
157 "lcms2-2.6/src/cmshalf.c",
158 "lcms2-2.6/src/cmsintrp.c",
159 "lcms2-2.6/src/cmsio0.c",
160 "lcms2-2.6/src/cmsio1.c",
161 "lcms2-2.6/src/cmslut.c",
162 "lcms2-2.6/src/cmsmd5.c",
163 "lcms2-2.6/src/cmsmtrx.c",
164 "lcms2-2.6/src/cmsnamed.c",
165 "lcms2-2.6/src/cmsopt.c",
166 "lcms2-2.6/src/cmspack.c",
167 "lcms2-2.6/src/cmspcs.c",
168 "lcms2-2.6/src/cmsplugin.c",
169 "lcms2-2.6/src/cmsps2.c",
170 "lcms2-2.6/src/cmssamp.c",
171 "lcms2-2.6/src/cmssm.c",
172 "lcms2-2.6/src/cmstypes.c",
173 "lcms2-2.6/src/cmsvirt.c",
174 "lcms2-2.6/src/cmswtpnt.c",
175 "lcms2-2.6/src/cmsxform.c",
176 ]
177}
178
Lei Zhang8241df72015-11-06 14:38:48 -0800179# This is only used for standalone builds.
180source_set("jpeg") {
Tom Sepez0a119752015-06-17 15:46:03 -0700181 configs -= [ "//build/config/compiler:chromium_code" ]
182 configs += [
183 "//build/config/compiler:no_chromium_code",
184 "//third_party/pdfium:pdfium_config",
185 ]
186 sources = [
187 "libjpeg/cderror.h",
188 "libjpeg/cdjpeg.h",
189 "libjpeg/fpdfapi_jcapimin.c",
190 "libjpeg/fpdfapi_jcapistd.c",
191 "libjpeg/fpdfapi_jccoefct.c",
192 "libjpeg/fpdfapi_jccolor.c",
193 "libjpeg/fpdfapi_jcdctmgr.c",
194 "libjpeg/fpdfapi_jchuff.c",
195 "libjpeg/fpdfapi_jcinit.c",
196 "libjpeg/fpdfapi_jcmainct.c",
197 "libjpeg/fpdfapi_jcmarker.c",
198 "libjpeg/fpdfapi_jcmaster.c",
199 "libjpeg/fpdfapi_jcomapi.c",
200 "libjpeg/fpdfapi_jcparam.c",
201 "libjpeg/fpdfapi_jcphuff.c",
202 "libjpeg/fpdfapi_jcprepct.c",
203 "libjpeg/fpdfapi_jcsample.c",
204 "libjpeg/fpdfapi_jctrans.c",
205 "libjpeg/fpdfapi_jdapimin.c",
206 "libjpeg/fpdfapi_jdapistd.c",
207 "libjpeg/fpdfapi_jdcoefct.c",
208 "libjpeg/fpdfapi_jdcolor.c",
209 "libjpeg/fpdfapi_jddctmgr.c",
210 "libjpeg/fpdfapi_jdhuff.c",
211 "libjpeg/fpdfapi_jdinput.c",
212 "libjpeg/fpdfapi_jdmainct.c",
213 "libjpeg/fpdfapi_jdmarker.c",
214 "libjpeg/fpdfapi_jdmaster.c",
215 "libjpeg/fpdfapi_jdmerge.c",
216 "libjpeg/fpdfapi_jdphuff.c",
217 "libjpeg/fpdfapi_jdpostct.c",
218 "libjpeg/fpdfapi_jdsample.c",
219 "libjpeg/fpdfapi_jdtrans.c",
220 "libjpeg/fpdfapi_jerror.c",
221 "libjpeg/fpdfapi_jfdctfst.c",
222 "libjpeg/fpdfapi_jfdctint.c",
223 "libjpeg/fpdfapi_jidctfst.c",
224 "libjpeg/fpdfapi_jidctint.c",
225 "libjpeg/fpdfapi_jidctred.c",
226 "libjpeg/fpdfapi_jmemmgr.c",
227 "libjpeg/fpdfapi_jmemnobs.c",
228 "libjpeg/fpdfapi_jutils.c",
229 "libjpeg/jchuff.h",
230 "libjpeg/jconfig.h",
231 "libjpeg/jdct.h",
232 "libjpeg/jdhuff.h",
233 "libjpeg/jerror.h",
234 "libjpeg/jinclude.h",
235 "libjpeg/jmemsys.h",
236 "libjpeg/jmorecfg.h",
237 "libjpeg/jpegint.h",
238 "libjpeg/jpeglib.h",
239 "libjpeg/jversion.h",
240 "libjpeg/makefile",
241 "libjpeg/transupp.h",
242 ]
243}
244
Tom Sepez6fd997b2015-06-18 17:51:37 -0700245source_set("fx_libopenjpeg") {
Tom Sepez54172662015-01-09 14:49:47 -0800246 configs -= [ "//build/config/compiler:chromium_code" ]
247 configs += [
Tom Sepez6fd997b2015-06-18 17:51:37 -0700248 "//build/config/compiler:no_chromium_code",
249 "//third_party/pdfium:pdfium_config",
250 ]
251 sources = [
252 "libopenjpeg20/bio.c",
253 "libopenjpeg20/cio.c",
254 "libopenjpeg20/dwt.c",
255 "libopenjpeg20/event.c",
256 "libopenjpeg20/function_list.c",
257 "libopenjpeg20/image.c",
258 "libopenjpeg20/invert.c",
259 "libopenjpeg20/j2k.c",
260 "libopenjpeg20/jp2.c",
261 "libopenjpeg20/mct.c",
262 "libopenjpeg20/mqc.c",
263 "libopenjpeg20/openjpeg.c",
264 "libopenjpeg20/opj_clock.c",
265 "libopenjpeg20/pi.c",
266 "libopenjpeg20/raw.c",
267 "libopenjpeg20/t1.c",
268 "libopenjpeg20/t2.c",
269 "libopenjpeg20/tcd.c",
270 "libopenjpeg20/tgt.c",
271 ]
272}
273
Tom Sepez5ef9faa2015-10-12 15:43:01 -0700274source_set("fx_lpng") {
275 configs -= [ "//build/config/compiler:chromium_code" ]
276 configs += [
277 "//build/config/compiler:no_chromium_code",
278 "//third_party/pdfium:pdfium_config",
279 ]
280 sources = [
Lei Zhanga76a6d82016-01-15 19:38:03 -0800281 "libpng16/png.c",
282 "libpng16/png.h",
283 "libpng16/pngconf.h",
284 "libpng16/pngdebug.h",
285 "libpng16/pngerror.c",
286 "libpng16/pngget.c",
287 "libpng16/pnginfo.h",
288 "libpng16/pnglibconf.h",
289 "libpng16/pngmem.c",
290 "libpng16/pngpread.c",
291 "libpng16/pngpriv.h",
292 "libpng16/pngread.c",
293 "libpng16/pngrio.c",
294 "libpng16/pngrtran.c",
295 "libpng16/pngrutil.c",
296 "libpng16/pngset.c",
297 "libpng16/pngstruct.h",
298 "libpng16/pngtrans.c",
299 "libpng16/pngwio.c",
300 "libpng16/pngwrite.c",
301 "libpng16/pngwtran.c",
302 "libpng16/pngwutil.c",
Tom Sepez5ef9faa2015-10-12 15:43:01 -0700303 ]
304}
305
Tom Sepez465ed872015-12-09 14:55:41 -0800306if (pdf_enable_xfa) {
307 source_set("fx_tiff") {
308 configs -= [ "//build/config/compiler:chromium_code" ]
309 configs += [
310 "//build/config/compiler:no_chromium_code",
311 "//third_party/pdfium:pdfium_config",
312 ]
Tom Sepezb8226d62016-01-12 16:00:23 -0800313 deps = [ "//third_party:jpeg" ]
Tom Sepez465ed872015-12-09 14:55:41 -0800314 sources = [
Lei Zhang9c2c87d2016-01-07 15:52:44 -0800315 "libtiff/tiffiop.h",
Lei Zhang77689da2016-01-07 15:58:35 -0800316 "libtiff/tiffvers.h",
Lei Zhang9c2c87d2016-01-07 15:52:44 -0800317 "libtiff/tif_aux.c",
318 "libtiff/tif_close.c",
319 "libtiff/tif_codec.c",
320 "libtiff/tif_color.c",
321 "libtiff/tif_compress.c",
322 "libtiff/tif_dir.c",
323 "libtiff/tif_dirinfo.c",
324 "libtiff/tif_dirread.c",
325 "libtiff/tif_dirwrite.c",
326 "libtiff/tif_dumpmode.c",
327 "libtiff/tif_error.c",
328 "libtiff/tif_extension.c",
329 "libtiff/tif_fax3.c",
330 "libtiff/tif_fax3sm.c",
331 "libtiff/tif_flush.c",
332 "libtiff/tif_getimage.c",
333 "libtiff/tif_jpeg.c",
334 "libtiff/tif_luv.c",
335 "libtiff/tif_lzw.c",
336 "libtiff/tif_next.c",
337 "libtiff/tif_ojpeg.c",
338 "libtiff/tif_open.c",
339 "libtiff/tif_packbits.c",
340 "libtiff/tif_pixarlog.c",
341 "libtiff/tif_predict.c",
342 "libtiff/tif_print.c",
343 "libtiff/tif_read.c",
344 "libtiff/tif_strip.c",
345 "libtiff/tif_swab.c",
346 "libtiff/tif_thunder.c",
347 "libtiff/tif_tile.c",
348 "libtiff/tif_version.c",
349 "libtiff/tif_warning.c",
350 "libtiff/tif_write.c",
351 "libtiff/tif_zip.c",
Tom Sepez465ed872015-12-09 14:55:41 -0800352 ]
353 }
Tom Sepez5ef9faa2015-10-12 15:43:01 -0700354}
355
Tom Sepez6f93de52015-06-19 12:57:10 -0700356source_set("fx_zlib") {
357 configs -= [ "//build/config/compiler:chromium_code" ]
358 configs += [
359 "//build/config/compiler:no_chromium_code",
360 "//third_party/pdfium:pdfium_config",
361 ]
362 sources = [
363 "zlib_v128/adler32.c",
364 "zlib_v128/compress.c",
365 "zlib_v128/crc32.c",
366 "zlib_v128/deflate.c",
367 "zlib_v128/gzclose.c",
368 "zlib_v128/gzlib.c",
369 "zlib_v128/gzread.c",
370 "zlib_v128/gzwrite.c",
371 "zlib_v128/infback.c",
372 "zlib_v128/inffast.c",
373 "zlib_v128/inflate.c",
374 "zlib_v128/inftrees.c",
375 "zlib_v128/trees.c",
376 "zlib_v128/uncompr.c",
377 "zlib_v128/zutil.c",
378 ]
379}
380
Tom Sepez6fd997b2015-06-18 17:51:37 -0700381source_set("pdfium_base") {
382 configs -= [ "//build/config/compiler:chromium_code" ]
383 configs += [
384 "//build/config/compiler:no_chromium_code",
385 "//third_party/pdfium:pdfium_config",
Tom Sepez54172662015-01-09 14:49:47 -0800386 ]
Bo Xu4c764f32014-12-19 14:29:17 -0800387 sources = [
Tom Sepez35425892015-02-05 10:03:18 -0800388 "base/logging.h",
389 "base/macros.h",
Tom Sepez35425892015-02-05 10:03:18 -0800390 "base/numerics/safe_conversions.h",
391 "base/numerics/safe_conversions_impl.h",
392 "base/numerics/safe_math.h",
393 "base/numerics/safe_math_impl.h",
Lei Zhang54285552015-10-09 13:57:36 -0700394 "base/stl_util.h",
Bo Xu4c764f32014-12-19 14:29:17 -0800395 ]
396}