Fix some clang warnings with -Wmissing-braces in pdfium.
[pdfium.git] / third_party / BUILD.gn
index b80ae51..37e30ce 100644 (file)
@@ -13,8 +13,8 @@ group("third_party") {
 source_set("bigint") {
   configs -= [ "//build/config/compiler:chromium_code" ]
   configs += [
-    "//third_party/pdfium:pdfium_config",
     "//build/config/compiler:no_chromium_code",
+    "//third_party/pdfium:pdfium_config",
   ]
   sources = [
     "bigint/BigInteger.cc",
@@ -33,8 +33,8 @@ source_set("bigint") {
 source_set("freetype") {
   configs -= [ "//build/config/compiler:chromium_code" ]
   configs += [
-    "//third_party/pdfium:pdfium_config",
     "//build/config/compiler:no_chromium_code",
+    "//third_party/pdfium:pdfium_config",
   ]
   defines = [ "FT2_BUILD_LIBRARY" ]
   sources = [
@@ -95,10 +95,18 @@ source_set("fx_agg") {
 }
 
 source_set("fx_lcms2") {
+  config("fx_lcms2_warnings") {
+    if (is_clang) {
+      # cmslut.cc is sloppy with aggregate initialization. Version 2.7 of this
+      # library doesn't appear to have this problem.
+      cflags = [ "-Wno-missing-braces" ]
+    }
+  }
   configs -= [ "//build/config/compiler:chromium_code" ]
   configs += [
     "//build/config/compiler:no_chromium_code",
     "//third_party/pdfium:pdfium_config",
+    ":fx_lcms2_warnings",
   ]
   sources = [
     "lcms2-2.6/include/lcms2.h",
@@ -131,11 +139,130 @@ source_set("fx_lcms2") {
   ]
 }
 
-source_set("pdfium_base") {
+source_set("fx_libjpeg") {
   configs -= [ "//build/config/compiler:chromium_code" ]
   configs += [
+    "//build/config/compiler:no_chromium_code",
     "//third_party/pdfium:pdfium_config",
+  ]
+  sources = [
+    "libjpeg/cderror.h",
+    "libjpeg/cdjpeg.h",
+    "libjpeg/fpdfapi_jcapimin.c",
+    "libjpeg/fpdfapi_jcapistd.c",
+    "libjpeg/fpdfapi_jccoefct.c",
+    "libjpeg/fpdfapi_jccolor.c",
+    "libjpeg/fpdfapi_jcdctmgr.c",
+    "libjpeg/fpdfapi_jchuff.c",
+    "libjpeg/fpdfapi_jcinit.c",
+    "libjpeg/fpdfapi_jcmainct.c",
+    "libjpeg/fpdfapi_jcmarker.c",
+    "libjpeg/fpdfapi_jcmaster.c",
+    "libjpeg/fpdfapi_jcomapi.c",
+    "libjpeg/fpdfapi_jcparam.c",
+    "libjpeg/fpdfapi_jcphuff.c",
+    "libjpeg/fpdfapi_jcprepct.c",
+    "libjpeg/fpdfapi_jcsample.c",
+    "libjpeg/fpdfapi_jctrans.c",
+    "libjpeg/fpdfapi_jdapimin.c",
+    "libjpeg/fpdfapi_jdapistd.c",
+    "libjpeg/fpdfapi_jdcoefct.c",
+    "libjpeg/fpdfapi_jdcolor.c",
+    "libjpeg/fpdfapi_jddctmgr.c",
+    "libjpeg/fpdfapi_jdhuff.c",
+    "libjpeg/fpdfapi_jdinput.c",
+    "libjpeg/fpdfapi_jdmainct.c",
+    "libjpeg/fpdfapi_jdmarker.c",
+    "libjpeg/fpdfapi_jdmaster.c",
+    "libjpeg/fpdfapi_jdmerge.c",
+    "libjpeg/fpdfapi_jdphuff.c",
+    "libjpeg/fpdfapi_jdpostct.c",
+    "libjpeg/fpdfapi_jdsample.c",
+    "libjpeg/fpdfapi_jdtrans.c",
+    "libjpeg/fpdfapi_jerror.c",
+    "libjpeg/fpdfapi_jfdctfst.c",
+    "libjpeg/fpdfapi_jfdctint.c",
+    "libjpeg/fpdfapi_jidctfst.c",
+    "libjpeg/fpdfapi_jidctint.c",
+    "libjpeg/fpdfapi_jidctred.c",
+    "libjpeg/fpdfapi_jmemmgr.c",
+    "libjpeg/fpdfapi_jmemnobs.c",
+    "libjpeg/fpdfapi_jutils.c",
+    "libjpeg/jchuff.h",
+    "libjpeg/jconfig.h",
+    "libjpeg/jdct.h",
+    "libjpeg/jdhuff.h",
+    "libjpeg/jerror.h",
+    "libjpeg/jinclude.h",
+    "libjpeg/jmemsys.h",
+    "libjpeg/jmorecfg.h",
+    "libjpeg/jpegint.h",
+    "libjpeg/jpeglib.h",
+    "libjpeg/jversion.h",
+    "libjpeg/makefile",
+    "libjpeg/transupp.h",
+  ]
+}
+
+source_set("fx_libopenjpeg") {
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [
     "//build/config/compiler:no_chromium_code",
+    "//third_party/pdfium:pdfium_config",
+  ]
+  sources = [
+    "libopenjpeg20/bio.c",
+    "libopenjpeg20/cio.c",
+    "libopenjpeg20/dwt.c",
+    "libopenjpeg20/event.c",
+    "libopenjpeg20/function_list.c",
+    "libopenjpeg20/image.c",
+    "libopenjpeg20/invert.c",
+    "libopenjpeg20/j2k.c",
+    "libopenjpeg20/jp2.c",
+    "libopenjpeg20/mct.c",
+    "libopenjpeg20/mqc.c",
+    "libopenjpeg20/openjpeg.c",
+    "libopenjpeg20/opj_clock.c",
+    "libopenjpeg20/pi.c",
+    "libopenjpeg20/raw.c",
+    "libopenjpeg20/t1.c",
+    "libopenjpeg20/t2.c",
+    "libopenjpeg20/tcd.c",
+    "libopenjpeg20/tgt.c",
+  ]
+}
+
+source_set("fx_zlib") {
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [
+    "//build/config/compiler:no_chromium_code",
+    "//third_party/pdfium:pdfium_config",
+  ]
+  sources = [
+    "zlib_v128/adler32.c",
+    "zlib_v128/compress.c",
+    "zlib_v128/crc32.c",
+    "zlib_v128/deflate.c",
+    "zlib_v128/gzclose.c",
+    "zlib_v128/gzlib.c",
+    "zlib_v128/gzread.c",
+    "zlib_v128/gzwrite.c",
+    "zlib_v128/infback.c",
+    "zlib_v128/inffast.c",
+    "zlib_v128/inflate.c",
+    "zlib_v128/inftrees.c",
+    "zlib_v128/trees.c",
+    "zlib_v128/uncompr.c",
+    "zlib_v128/zutil.c",
+  ]
+}
+
+source_set("pdfium_base") {
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [
+    "//build/config/compiler:no_chromium_code",
+    "//third_party/pdfium:pdfium_config",
   ]
   sources = [
     "base/logging.h",