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