Add test for PDF's JS "global".
[pdfium.git] / BUILD.gn
index 4f97e34..93a6c06 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -6,13 +6,16 @@ import("//testing/test.gni")
 
 pdf_use_skia = false
 
+declare_args() {
+  # On Android there's no system FreeType. On Windows and Mac, only a few
+  # methods are used from it.
+  bundle_freetype = !is_linux
+}
+
 config("pdfium_config") {
   cflags = []
-  include_dirs = [
-    "third_party/freetype/include"
-  ]
+  include_dirs = [ "third_party/freetype/include" ]
   defines = [
-    "FT2_BUILD_LIBRARY",
     "_FPDFSDK_LIB",
     "_NO_GDIPLUS_",  # workaround text rendering issues on Windows
     "OPJ_STATIC",
@@ -92,8 +95,7 @@ static_library("pdfium") {
 
   deps = [
     "third_party:bigint",
-    "third_party:freetype",
-    "third_party:safemath",
+    "third_party:pdfium_base",
     ":fdrm",
     ":formfiller",
     ":fpdfapi",
@@ -115,6 +117,12 @@ static_library("pdfium") {
   if (is_mac) {
     libs += [ "AppKit.framework", "CoreFoundation.framework" ]
   }
+
+  if (bundle_freetype) {
+    deps += [ "third_party:freetype" ]
+  } else {
+    libs += [ "freetype" ]
+  }
 }
 
 # Targets below this are only visible within this file.
@@ -248,7 +256,6 @@ static_library("fpdfapi") {
     "core/src/fpdfapi/fpdf_font/fpdf_font.cpp",
     "core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp",
     "core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp",
-    "core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp",
     "core/src/fpdfapi/fpdf_font/ttgsubtable.cpp",
     "core/src/fpdfapi/fpdf_font/ttgsubtable.h",
     "core/src/fpdfapi/fpdf_page/fpdf_page.cpp",
@@ -331,7 +338,6 @@ static_library("fxcodec") {
     "core/src/fxcodec/fx_libopenjpeg/src/fx_pi.c",
     "core/src/fxcodec/fx_libopenjpeg/src/fx_raw.c",
     "core/src/fxcodec/fx_libopenjpeg/src/fx_t1.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_t1_generate_luts.c",
     "core/src/fxcodec/fx_libopenjpeg/src/fx_t2.c",
     "core/src/fxcodec/fx_libopenjpeg/src/fx_tcd.c",
     "core/src/fxcodec/fx_libopenjpeg/src/fx_tgt.c",
@@ -483,6 +489,7 @@ static_library("fxcrt") {
     "core/include/fxcrt/fx_ucd.h",
     "core/include/fxcrt/fx_xml.h",
     "core/src/fxcrt/extension.h",
+    "core/src/fxcrt/fx_safe_types.h",
     "core/src/fxcrt/fxcrt_platforms.cpp",
     "core/src/fxcrt/fxcrt_platforms.h",
     "core/src/fxcrt/fxcrt_posix.cpp",
@@ -741,9 +748,6 @@ static_library("javascript") {
   public_deps = [
     "//v8",
   ]
-  deps = [
-    "//v8:v8_libplatform",
-  ]
 }
 
 static_library("jsapi") {
@@ -813,7 +817,9 @@ test("pdfium_unittests") {
 
 test("pdfium_embeddertests") {
   sources = [
+    "fpdfsdk/src/fpdf_dataavail_embeddertest.cpp",
     "fpdfsdk/src/fpdfdoc_embeddertest.cpp",
+    "fpdfsdk/src/fpdftext_embeddertest.cpp",
     "fpdfsdk/src/fpdfview_embeddertest.cpp",
     "testing/embedder_test.cpp",
     "testing/embedder_test.h",