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