Fix some clang warnings with -Wmissing-braces in pdfium.
[pdfium.git] / third_party / BUILD.gn
index 666afe5..37e30ce 100644 (file)
@@ -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",
@@ -202,7 +210,6 @@ source_set("fx_libopenjpeg") {
     "//build/config/compiler:no_chromium_code",
     "//third_party/pdfium:pdfium_config",
   ]
-  defines = [ "_CRT_SECURE_NO_WARNINGS" ]
   sources = [
     "libopenjpeg20/bio.c",
     "libopenjpeg20/cio.c",
@@ -226,6 +233,31 @@ source_set("fx_libopenjpeg") {
   ]
 }
 
+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 += [