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 import("../pdfium.gni") 6 7 group("third_party") { 8 deps = [ 9 ":bigint", 10 ":fx_freetype", 11 ":pdfium_base", 12 ] 13 } 14 15 source_set("bigint") { 16 configs -= [ "//build/config/compiler:chromium_code" ] 17 configs += [ 18 "//build/config/compiler:no_chromium_code", 19 "//third_party/pdfium:pdfium_config", 20 ] 21 sources = [ 22 "bigint/BigInteger.cc", 23 "bigint/BigInteger.hh", 24 "bigint/BigIntegerLibrary.hh", 25 "bigint/BigIntegerUtils.cc", 26 "bigint/BigIntegerUtils.hh", 27 "bigint/BigUnsigned.cc", 28 "bigint/BigUnsigned.hh", 29 "bigint/BigUnsignedInABase.cc", 30 "bigint/BigUnsignedInABase.hh", 31 "bigint/NumberlikeArray.hh", 32 ] 33 } 34 35 config("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 44 # Tests may link against this even if the production library doesn't, 45 # so it needs to be separate from it. 46 static_library("fx_freetype") { 47 configs -= [ "//build/config/compiler:chromium_code" ] 48 configs += [ 49 "//build/config/compiler:no_chromium_code", 50 "//third_party/pdfium:pdfium_config", 51 52 # Must be after no_chromium_code for warning flags to be ordered correctly. 53 ":fx_freetype_warnings", 54 ] 55 defines = [ "FT2_BUILD_LIBRARY" ] 56 sources = [ 57 "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", 65 "freetype/include/ft2build.h", 66 "freetype/src/base/ftbase.c", 67 "freetype/src/base/ftbase.h", 68 "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", 74 "freetype/src/cff/cff.c", 75 "freetype/src/cff/cffobjs.h", 76 "freetype/src/cff/cfftypes.h", 77 "freetype/src/cid/type1cid.c", 78 "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", 86 ] 87 } 88 89 config("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 97 source_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", 102 103 # Must be after no_chromium_code for warning flags to be ordered correctly. 104 ":fx_agg_warnings", 105 ] 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 125 config("fx_lcms2_warnings") { 126 visibility = [ ":*" ] 127 if (is_clang) { 128 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 ] 136 } 137 } 138 139 source_set("fx_lcms2") { 140 configs -= [ "//build/config/compiler:chromium_code" ] 141 configs += [ 142 "//build/config/compiler:no_chromium_code", 143 "//third_party/pdfium:pdfium_config", 144 145 # Must be after no_chromium_code for warning flags to be ordered correctly. 146 ":fx_lcms2_warnings", 147 ] 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 179 # This is only used for standalone builds. 180 source_set("jpeg") { 181 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 245 source_set("fx_libopenjpeg") { 246 configs -= [ "//build/config/compiler:chromium_code" ] 247 configs += [ 248 "//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 274 source_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 = [ 281 "lpng_v163/png.h", 282 "lpng_v163/png.c", 283 "lpng_v163/pngerror.c", 284 "lpng_v163/pngget.c", 285 "lpng_v163/pngmem.c", 286 "lpng_v163/pngpread.c", 287 "lpng_v163/pngread.c", 288 "lpng_v163/pngrio.c", 289 "lpng_v163/pngrtran.c", 290 "lpng_v163/pngrutil.c", 291 "lpng_v163/pngset.c", 292 "lpng_v163/pngtrans.c", 293 "lpng_v163/pngwio.c", 294 "lpng_v163/pngwrite.c", 295 "lpng_v163/pngwtran.c", 296 "lpng_v163/pngwutil.c", 297 ] 298 } 299 300 if (pdf_enable_xfa) { 301 source_set("fx_tiff") { 302 configs -= [ "//build/config/compiler:chromium_code" ] 303 configs += [ 304 "//build/config/compiler:no_chromium_code", 305 "//third_party/pdfium:pdfium_config", 306 ] 307 deps = [ "//third_party:jpeg" ] 308 sources = [ 309 "libtiff/tiffiop.h", 310 "libtiff/tiffvers.h", 311 "libtiff/tif_aux.c", 312 "libtiff/tif_close.c", 313 "libtiff/tif_codec.c", 314 "libtiff/tif_color.c", 315 "libtiff/tif_compress.c", 316 "libtiff/tif_dir.c", 317 "libtiff/tif_dirinfo.c", 318 "libtiff/tif_dirread.c", 319 "libtiff/tif_dirwrite.c", 320 "libtiff/tif_dumpmode.c", 321 "libtiff/tif_error.c", 322 "libtiff/tif_extension.c", 323 "libtiff/tif_fax3.c", 324 "libtiff/tif_fax3sm.c", 325 "libtiff/tif_flush.c", 326 "libtiff/tif_getimage.c", 327 "libtiff/tif_jpeg.c", 328 "libtiff/tif_luv.c", 329 "libtiff/tif_lzw.c", 330 "libtiff/tif_next.c", 331 "libtiff/tif_ojpeg.c", 332 "libtiff/tif_open.c", 333 "libtiff/tif_packbits.c", 334 "libtiff/tif_pixarlog.c", 335 "libtiff/tif_predict.c", 336 "libtiff/tif_print.c", 337 "libtiff/tif_read.c", 338 "libtiff/tif_strip.c", 339 "libtiff/tif_swab.c", 340 "libtiff/tif_thunder.c", 341 "libtiff/tif_tile.c", 342 "libtiff/tif_version.c", 343 "libtiff/tif_warning.c", 344 "libtiff/tif_write.c", 345 "libtiff/tif_zip.c", 346 ] 347 } 348 } 349 350 source_set("fx_zlib") { 351 configs -= [ "//build/config/compiler:chromium_code" ] 352 configs += [ 353 "//build/config/compiler:no_chromium_code", 354 "//third_party/pdfium:pdfium_config", 355 ] 356 sources = [ 357 "zlib_v128/adler32.c", 358 "zlib_v128/compress.c", 359 "zlib_v128/crc32.c", 360 "zlib_v128/deflate.c", 361 "zlib_v128/gzclose.c", 362 "zlib_v128/gzlib.c", 363 "zlib_v128/gzread.c", 364 "zlib_v128/gzwrite.c", 365 "zlib_v128/infback.c", 366 "zlib_v128/inffast.c", 367 "zlib_v128/inflate.c", 368 "zlib_v128/inftrees.c", 369 "zlib_v128/trees.c", 370 "zlib_v128/uncompr.c", 371 "zlib_v128/zutil.c", 372 ] 373 } 374 375 source_set("pdfium_base") { 376 configs -= [ "//build/config/compiler:chromium_code" ] 377 configs += [ 378 "//build/config/compiler:no_chromium_code", 379 "//third_party/pdfium:pdfium_config", 380 ] 381 sources = [ 382 "base/logging.h", 383 "base/macros.h", 384 "base/numerics/safe_conversions.h", 385 "base/numerics/safe_conversions_impl.h", 386 "base/numerics/safe_math.h", 387 "base/numerics/safe_math_impl.h", 388 "base/stl_util.h", 389 ] 390 } 391