Cosmetic changes in fsdk_define.h
[pdfium.git] / third_party / BUILD.gn
index 666afe5..f635814 100644 (file)
@@ -5,7 +5,7 @@
 group("third_party") {
   deps = [
     ":bigint",
-    ":freetype",
+    ":fx_freetype",
     ":pdfium_base",
   ]
 }
@@ -30,11 +30,23 @@ source_set("bigint") {
   ]
 }
 
-source_set("freetype") {
+config("fx_freetype_warnings") {
+  visibility = [ ":*" ]
+  if (is_clang) {
+    # open_face_PS_from_sfnt_stream() and open_face_from_buffer() in
+    # ftbase.h are unused.
+    cflags = [ "-Wno-unused-function" ]
+  }
+}
+
+# Tests may link against this even if the production library doesn't,
+# so it needs to be separate from it.
+static_library("fx_freetype") {
   configs -= [ "//build/config/compiler:chromium_code" ]
   configs += [
     "//build/config/compiler:no_chromium_code",
     "//third_party/pdfium:pdfium_config",
+    ":fx_freetype_warnings",
   ]
   defines = [ "FT2_BUILD_LIBRARY" ]
   sources = [
@@ -48,6 +60,7 @@ source_set("freetype") {
     "freetype/include/internal/tttypes.h",
     "freetype/include/tttables.h",
     "freetype/src/base/ftbase.c",
+    "freetype/src/base/ftbase.h",
     "freetype/src/base/ftbitmap.c",
     "freetype/src/base/ftglyph.c",
     "freetype/src/base/ftinit.c",
@@ -69,11 +82,20 @@ source_set("freetype") {
   ]
 }
 
+config("fx_agg_warnings") {
+  visibility = [ ":*" ]
+  if (is_clang) {
+    # calc_butt_cap() in agg_vcgen_stroke.cpp is unused.
+    cflags = [ "-Wno-unused-function" ]
+  }
+}
+
 source_set("fx_agg") {
   configs -= [ "//build/config/compiler:chromium_code" ]
   configs += [
     "//build/config/compiler:no_chromium_code",
     "//third_party/pdfium:pdfium_config",
+    ":fx_agg_warnings",
   ]
   sources = [
     "agg23/agg_basics.h",
@@ -94,11 +116,25 @@ source_set("fx_agg") {
   ]
 }
 
+config("fx_lcms2_warnings") {
+  visibility = [ ":*" ]
+  if (is_clang) {
+    cflags = [
+      # cmslut.cc is sloppy with aggregate initialization. Version 2.7 of this
+      # library doesn't appear to have this problem.
+      "-Wno-missing-braces",
+      # FindPrev() in cmsplugin.c is unused.
+      "-Wno-unused-function",
+    ]
+  }
+}
+
 source_set("fx_lcms2") {
   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 +238,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 +261,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 += [
@@ -240,6 +300,7 @@ source_set("pdfium_base") {
     "base/numerics/safe_conversions_impl.h",
     "base/numerics/safe_math.h",
     "base/numerics/safe_math_impl.h",
+    "base/stl_util.h",
     "base/template_util.h",
   ]
 }