Cleanup: Fix a typo. s/Processive/Processing/
[pdfium.git] / third_party / BUILD.gn
1 # 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
5 group("third_party") {
6   deps = [
7     ":bigint",
8     ":fx_freetype",
9     ":pdfium_base",
10   ]
11 }
12
13 source_set("bigint") {
14   configs -= [ "//build/config/compiler:chromium_code" ]
15   configs += [
16     "//build/config/compiler:no_chromium_code",
17     "//third_party/pdfium:pdfium_config",
18   ]
19   sources = [
20     "bigint/BigInteger.cc",
21     "bigint/BigInteger.hh",
22     "bigint/BigIntegerLibrary.hh",
23     "bigint/BigIntegerUtils.cc",
24     "bigint/BigIntegerUtils.hh",
25     "bigint/BigUnsigned.cc",
26     "bigint/BigUnsigned.hh",
27     "bigint/BigUnsignedInABase.cc",
28     "bigint/BigUnsignedInABase.hh",
29     "bigint/NumberlikeArray.hh",
30   ]
31 }
32
33 config("fx_freetype_warnings") {
34   visibility = [ ":*" ]
35   if (is_clang) {
36     # open_face_PS_from_sfnt_stream() and open_face_from_buffer() in
37     # ftbase.h are unused.
38     cflags = [ "-Wno-unused-function" ]
39   }
40 }
41
42 # Tests may link against this even if the production library doesn't,
43 # so it needs to be separate from it.
44 static_library("fx_freetype") {
45   configs -= [ "//build/config/compiler:chromium_code" ]
46   configs += [
47     "//build/config/compiler:no_chromium_code",
48     "//third_party/pdfium:pdfium_config",
49     ":fx_freetype_warnings",
50   ]
51   defines = [ "FT2_BUILD_LIBRARY" ]
52   sources = [
53     "freetype/include/freetype.h",
54     "freetype/include/ft2build.h",
55     "freetype/include/ftmm.h",
56     "freetype/include/ftotval.h",
57     "freetype/include/ftoutln.h",
58     "freetype/include/internal/ftobjs.h",
59     "freetype/include/internal/ftstream.h",
60     "freetype/include/internal/tttypes.h",
61     "freetype/include/tttables.h",
62     "freetype/src/base/ftbase.c",
63     "freetype/src/base/ftbase.h",
64     "freetype/src/base/ftbitmap.c",
65     "freetype/src/base/ftglyph.c",
66     "freetype/src/base/ftinit.c",
67     "freetype/src/base/ftlcdfil.c",
68     "freetype/src/base/ftmm.c",
69     "freetype/src/base/ftsystem.c",
70     "freetype/src/cff/cff.c",
71     "freetype/src/cff/cffobjs.h",
72     "freetype/src/cff/cfftypes.h",
73     "freetype/src/cid/type1cid.c",
74     "freetype/src/psaux/psaux.c",
75     "freetype/src/pshinter/pshinter.c",
76     "freetype/src/psnames/psmodule.c",
77     "freetype/src/raster/raster.c",
78     "freetype/src/sfnt/sfnt.c",
79     "freetype/src/smooth/smooth.c",
80     "freetype/src/truetype/truetype.c",
81     "freetype/src/type1/type1.c",
82   ]
83 }
84
85 config("fx_agg_warnings") {
86   visibility = [ ":*" ]
87   if (is_clang) {
88     # calc_butt_cap() in agg_vcgen_stroke.cpp is unused.
89     cflags = [ "-Wno-unused-function" ]
90   }
91 }
92
93 source_set("fx_agg") {
94   configs -= [ "//build/config/compiler:chromium_code" ]
95   configs += [
96     "//build/config/compiler:no_chromium_code",
97     "//third_party/pdfium:pdfium_config",
98     ":fx_agg_warnings",
99   ]
100   sources = [
101     "agg23/agg_basics.h",
102     "agg23/agg_clip_liang_barsky.h",
103     "agg23/agg_conv_dash.h",
104     "agg23/agg_conv_stroke.h",
105     "agg23/agg_curves.cpp",
106     "agg23/agg_curves.h",
107     "agg23/agg_path_storage.cpp",
108     "agg23/agg_path_storage.h",
109     "agg23/agg_rasterizer_scanline_aa.cpp",
110     "agg23/agg_rasterizer_scanline_aa.h",
111     "agg23/agg_renderer_scanline.h",
112     "agg23/agg_rendering_buffer.h",
113     "agg23/agg_scanline_u.h",
114     "agg23/agg_vcgen_dash.cpp",
115     "agg23/agg_vcgen_stroke.cpp",
116   ]
117 }
118
119 config("fx_lcms2_warnings") {
120   visibility = [ ":*" ]
121   if (is_clang) {
122     cflags = [
123       # cmslut.cc is sloppy with aggregate initialization. Version 2.7 of this
124       # library doesn't appear to have this problem.
125       "-Wno-missing-braces",
126       # FindPrev() in cmsplugin.c is unused.
127       "-Wno-unused-function",
128     ]
129   }
130 }
131
132 source_set("fx_lcms2") {
133   configs -= [ "//build/config/compiler:chromium_code" ]
134   configs += [
135     "//build/config/compiler:no_chromium_code",
136     "//third_party/pdfium:pdfium_config",
137     ":fx_lcms2_warnings",
138   ]
139   sources = [
140     "lcms2-2.6/include/lcms2.h",
141     "lcms2-2.6/include/lcms2_plugin.h",
142     "lcms2-2.6/src/cmscam02.c",
143     "lcms2-2.6/src/cmscgats.c",
144     "lcms2-2.6/src/cmscnvrt.c",
145     "lcms2-2.6/src/cmserr.c",
146     "lcms2-2.6/src/cmsgamma.c",
147     "lcms2-2.6/src/cmsgmt.c",
148     "lcms2-2.6/src/cmshalf.c",
149     "lcms2-2.6/src/cmsintrp.c",
150     "lcms2-2.6/src/cmsio0.c",
151     "lcms2-2.6/src/cmsio1.c",
152     "lcms2-2.6/src/cmslut.c",
153     "lcms2-2.6/src/cmsmd5.c",
154     "lcms2-2.6/src/cmsmtrx.c",
155     "lcms2-2.6/src/cmsnamed.c",
156     "lcms2-2.6/src/cmsopt.c",
157     "lcms2-2.6/src/cmspack.c",
158     "lcms2-2.6/src/cmspcs.c",
159     "lcms2-2.6/src/cmsplugin.c",
160     "lcms2-2.6/src/cmsps2.c",
161     "lcms2-2.6/src/cmssamp.c",
162     "lcms2-2.6/src/cmssm.c",
163     "lcms2-2.6/src/cmstypes.c",
164     "lcms2-2.6/src/cmsvirt.c",
165     "lcms2-2.6/src/cmswtpnt.c",
166     "lcms2-2.6/src/cmsxform.c",
167   ]
168 }
169
170 source_set("fx_libjpeg") {
171   configs -= [ "//build/config/compiler:chromium_code" ]
172   configs += [
173     "//build/config/compiler:no_chromium_code",
174     "//third_party/pdfium:pdfium_config",
175   ]
176   sources = [
177     "libjpeg/cderror.h",
178     "libjpeg/cdjpeg.h",
179     "libjpeg/fpdfapi_jcapimin.c",
180     "libjpeg/fpdfapi_jcapistd.c",
181     "libjpeg/fpdfapi_jccoefct.c",
182     "libjpeg/fpdfapi_jccolor.c",
183     "libjpeg/fpdfapi_jcdctmgr.c",
184     "libjpeg/fpdfapi_jchuff.c",
185     "libjpeg/fpdfapi_jcinit.c",
186     "libjpeg/fpdfapi_jcmainct.c",
187     "libjpeg/fpdfapi_jcmarker.c",
188     "libjpeg/fpdfapi_jcmaster.c",
189     "libjpeg/fpdfapi_jcomapi.c",
190     "libjpeg/fpdfapi_jcparam.c",
191     "libjpeg/fpdfapi_jcphuff.c",
192     "libjpeg/fpdfapi_jcprepct.c",
193     "libjpeg/fpdfapi_jcsample.c",
194     "libjpeg/fpdfapi_jctrans.c",
195     "libjpeg/fpdfapi_jdapimin.c",
196     "libjpeg/fpdfapi_jdapistd.c",
197     "libjpeg/fpdfapi_jdcoefct.c",
198     "libjpeg/fpdfapi_jdcolor.c",
199     "libjpeg/fpdfapi_jddctmgr.c",
200     "libjpeg/fpdfapi_jdhuff.c",
201     "libjpeg/fpdfapi_jdinput.c",
202     "libjpeg/fpdfapi_jdmainct.c",
203     "libjpeg/fpdfapi_jdmarker.c",
204     "libjpeg/fpdfapi_jdmaster.c",
205     "libjpeg/fpdfapi_jdmerge.c",
206     "libjpeg/fpdfapi_jdphuff.c",
207     "libjpeg/fpdfapi_jdpostct.c",
208     "libjpeg/fpdfapi_jdsample.c",
209     "libjpeg/fpdfapi_jdtrans.c",
210     "libjpeg/fpdfapi_jerror.c",
211     "libjpeg/fpdfapi_jfdctfst.c",
212     "libjpeg/fpdfapi_jfdctint.c",
213     "libjpeg/fpdfapi_jidctfst.c",
214     "libjpeg/fpdfapi_jidctint.c",
215     "libjpeg/fpdfapi_jidctred.c",
216     "libjpeg/fpdfapi_jmemmgr.c",
217     "libjpeg/fpdfapi_jmemnobs.c",
218     "libjpeg/fpdfapi_jutils.c",
219     "libjpeg/jchuff.h",
220     "libjpeg/jconfig.h",
221     "libjpeg/jdct.h",
222     "libjpeg/jdhuff.h",
223     "libjpeg/jerror.h",
224     "libjpeg/jinclude.h",
225     "libjpeg/jmemsys.h",
226     "libjpeg/jmorecfg.h",
227     "libjpeg/jpegint.h",
228     "libjpeg/jpeglib.h",
229     "libjpeg/jversion.h",
230     "libjpeg/makefile",
231     "libjpeg/transupp.h",
232   ]
233 }
234
235 source_set("fx_libopenjpeg") {
236   configs -= [ "//build/config/compiler:chromium_code" ]
237   configs += [
238     "//build/config/compiler:no_chromium_code",
239     "//third_party/pdfium:pdfium_config",
240   ]
241   sources = [
242     "libopenjpeg20/bio.c",
243     "libopenjpeg20/cio.c",
244     "libopenjpeg20/dwt.c",
245     "libopenjpeg20/event.c",
246     "libopenjpeg20/function_list.c",
247     "libopenjpeg20/image.c",
248     "libopenjpeg20/invert.c",
249     "libopenjpeg20/j2k.c",
250     "libopenjpeg20/jp2.c",
251     "libopenjpeg20/mct.c",
252     "libopenjpeg20/mqc.c",
253     "libopenjpeg20/openjpeg.c",
254     "libopenjpeg20/opj_clock.c",
255     "libopenjpeg20/pi.c",
256     "libopenjpeg20/raw.c",
257     "libopenjpeg20/t1.c",
258     "libopenjpeg20/t2.c",
259     "libopenjpeg20/tcd.c",
260     "libopenjpeg20/tgt.c",
261   ]
262 }
263
264 source_set("fx_zlib") {
265   configs -= [ "//build/config/compiler:chromium_code" ]
266   configs += [
267     "//build/config/compiler:no_chromium_code",
268     "//third_party/pdfium:pdfium_config",
269   ]
270   sources = [
271     "zlib_v128/adler32.c",
272     "zlib_v128/compress.c",
273     "zlib_v128/crc32.c",
274     "zlib_v128/deflate.c",
275     "zlib_v128/gzclose.c",
276     "zlib_v128/gzlib.c",
277     "zlib_v128/gzread.c",
278     "zlib_v128/gzwrite.c",
279     "zlib_v128/infback.c",
280     "zlib_v128/inffast.c",
281     "zlib_v128/inflate.c",
282     "zlib_v128/inftrees.c",
283     "zlib_v128/trees.c",
284     "zlib_v128/uncompr.c",
285     "zlib_v128/zutil.c",
286   ]
287 }
288
289 source_set("pdfium_base") {
290   configs -= [ "//build/config/compiler:chromium_code" ]
291   configs += [
292     "//build/config/compiler:no_chromium_code",
293     "//third_party/pdfium:pdfium_config",
294   ]
295   sources = [
296     "base/logging.h",
297     "base/macros.h",
298     "base/nonstd_unique_ptr.h",
299     "base/numerics/safe_conversions.h",
300     "base/numerics/safe_conversions_impl.h",
301     "base/numerics/safe_math.h",
302     "base/numerics/safe_math_impl.h",
303     "base/template_util.h",
304   ]
305 }