Fix a leak in CJBig2_CachePair.
[pdfium.git] / BUILD.gn
index 97a475d..ec28f17 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -16,10 +16,9 @@ config("pdfium_config") {
   cflags = []
   include_dirs = [ "third_party/freetype/include" ]
   defines = [
-    "_FPDFSDK_LIB",
-    "_NO_GDIPLUS_",  # workaround text rendering issues on Windows
     "OPJ_STATIC",
     "V8_DEPRECATION_WARNINGS",
+    "_CRT_SECURE_NO_WARNINGS",
   ]
 
   if (pdf_use_skia) {
@@ -132,7 +131,7 @@ static_library("pdfium") {
   }
 
   if (pdfium_bundle_freetype) {
-    deps += [ "third_party:freetype" ]
+    deps += [ "third_party:fx_freetype" ]
   } else {
     libs += [ "freetype" ]
   }
@@ -251,8 +250,6 @@ static_library("fpdfapi") {
     "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp",
     "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp",
     "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp",
-    "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp",
-    "core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp",
     "core/src/fpdfapi/fpdf_cmaps/Japan1/V_1.cpp",
     "core/src/fpdfapi/fpdf_cmaps/Japan1/cmaps_japan1.cpp",
     "core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp",
@@ -292,12 +289,10 @@ static_library("fpdfapi") {
     "core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp",
     "core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp",
     "core/src/fpdfapi/fpdf_page/pageint.h",
-    "core/src/fpdfapi/fpdf_parser/filters_int.h",
     "core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp",
     "core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp",
     "core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp",
     "core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp",
-    "core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp",
     "core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp",
     "core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp",
     "core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp",
@@ -326,6 +321,7 @@ static_library("fpdftext") {
     "core/src/fpdftext/txtproc.h",
     "core/src/fpdftext/unicodenormalization.cpp",
     "core/src/fpdftext/unicodenormalizationdata.cpp",
+    "core/src/fpdftext/unicodenormalizationdata.h",
   ]
   configs -= [ "//build/config/compiler:chromium_code" ]
   configs += [
@@ -338,10 +334,13 @@ static_library("fxcodec") {
   deps = [
     "third_party:fx_lcms2",
     "third_party:fx_libjpeg",
+    "third_party:fx_libopenjpeg",
+    "third_party:fx_zlib",
   ]
   sources = [
     "core/include/fxcodec/fx_codec.h",
     "core/include/fxcodec/fx_codec_def.h",
+    "core/include/fxcodec/fx_codec_flate.h",
     "core/include/fxcodec/fx_codec_provider.h",
     "core/src/fxcodec/codec/codec_int.h",
     "core/src/fxcodec/codec/fx_codec.cpp",
@@ -352,44 +351,6 @@ static_library("fxcodec") {
     "core/src/fxcodec/codec/fx_codec_jbig_enc.cpp",
     "core/src/fxcodec/codec/fx_codec_jpeg.cpp",
     "core/src/fxcodec/codec/fx_codec_jpx_opj.cpp",
-    "core/src/fxcodec/fx_libopenjpeg/include/fx_openjpeg.h",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_bio.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_cio.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_dwt.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_event.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_function_list.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_image.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_invert.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_j2k.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_j2k_lib.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_jpt.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_mct.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_mqc.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_openjpeg.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_openjpeg_jp2.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_opj_clock.c",
-    "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_t2.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_tcd.c",
-    "core/src/fxcodec/fx_libopenjpeg/src/fx_tgt.c",
-    "core/src/fxcodec/fx_zlib/include/fx_zlib.h",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_adler32.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_compress.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_crc32.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_deflate.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_gzclose.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_gzlib.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_gzread.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_gzwrite.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_infback.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_inffast.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_inflate.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_inftrees.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_trees.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_uncompr.c",
-    "core/src/fxcodec/fx_zlib/src/fx_zlib_zutil.c",
     "core/src/fxcodec/jbig2/JBig2_ArithDecoder.h",
     "core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp",
     "core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.h",
@@ -408,9 +369,6 @@ static_library("fxcodec") {
     "core/src/fxcodec/jbig2/JBig2_Image.cpp",
     "core/src/fxcodec/jbig2/JBig2_Image.h",
     "core/src/fxcodec/jbig2/JBig2_List.h",
-    "core/src/fxcodec/jbig2/JBig2_Module.h",
-    "core/src/fxcodec/jbig2/JBig2_Object.cpp",
-    "core/src/fxcodec/jbig2/JBig2_Object.h",
     "core/src/fxcodec/jbig2/JBig2_Page.h",
     "core/src/fxcodec/jbig2/JBig2_PatternDict.cpp",
     "core/src/fxcodec/jbig2/JBig2_PatternDict.h",
@@ -418,9 +376,6 @@ static_library("fxcodec") {
     "core/src/fxcodec/jbig2/JBig2_Segment.h",
     "core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp",
     "core/src/fxcodec/jbig2/JBig2_SymbolDict.h",
-    "core/src/fxcodec/lcms2/fx_lcms2.h",
-    "core/src/fxcodec/lcms2/fx_lcms2_plugin.h",
-    "core/src/fxcodec/libjpeg/fx_libjpeg.h",
   ]
   configs -= [ "//build/config/compiler:chromium_code" ]
 
@@ -435,10 +390,19 @@ static_library("fxcodec") {
   ]
 }
 
+config("fxge_warnings") {
+  if (is_clang) {
+    cflags = [
+      # http://code.google.com/p/pdfium/issues/detail?id=188
+      "-Wno-switch",
+    ]
+  }
+}
+
 static_library("fxcrt") {
   sources = [
-    "core/include/fxcrt/fx_arb.h",
     "core/include/fxcrt/fx_basic.h",
+    "core/include/fxcrt/fx_bidi.h",
     "core/include/fxcrt/fx_coordinates.h",
     "core/include/fxcrt/fx_ext.h",
     "core/include/fxcrt/fx_memory.h",
@@ -449,8 +413,6 @@ static_library("fxcrt") {
     "core/include/fxcrt/fx_ucd.h",
     "core/include/fxcrt/fx_xml.h",
     "core/src/fxcrt/extension.h",
-    "core/src/fxcrt/fx_arabic.cpp",
-    "core/src/fxcrt/fx_arabic.h",
     "core/src/fxcrt/fx_basic_array.cpp",
     "core/src/fxcrt/fx_basic_bstring.cpp",
     "core/src/fxcrt/fx_basic_buffer.cpp",
@@ -463,6 +425,7 @@ static_library("fxcrt") {
     "core/src/fxcrt/fx_basic_utf.cpp",
     "core/src/fxcrt/fx_basic_util.cpp",
     "core/src/fxcrt/fx_basic_wstring.cpp",
+    "core/src/fxcrt/fx_bidi.cpp",
     "core/src/fxcrt/fx_extension.cpp",
     "core/src/fxcrt/fx_ucddata.cpp",
     "core/src/fxcrt/fx_unicode.cpp",
@@ -518,6 +481,7 @@ static_library("fxge") {
     "core/src/fxge/dib/fx_dib_engine.cpp",
     "core/src/fxge/dib/fx_dib_main.cpp",
     "core/src/fxge/dib/fx_dib_transform.cpp",
+    "core/src/fxge/fontdata/chromefontdata/chromefontdata.h",
     "core/src/fxge/fontdata/chromefontdata/FoxitDingbats.c",
     "core/src/fxge/fontdata/chromefontdata/FoxitFixed.c",
     "core/src/fxge/fontdata/chromefontdata/FoxitFixedBold.c",
@@ -550,6 +514,7 @@ static_library("fxge") {
   configs += [
     ":pdfium_config",
     "//build/config/compiler:no_chromium_code",
+    ":fxge_warnings",
   ]
 
   if (pdf_use_skia) {
@@ -771,8 +736,11 @@ test("pdfium_unittests") {
     "core/src/fxcrt/fx_basic_bstring_unittest.cpp",
     "core/src/fxcrt/fx_basic_memmgr_unittest.cpp",
     "core/src/fxcrt/fx_basic_wstring_unittest.cpp",
+    "core/src/fxcrt/fx_bidi_unittest.cpp",
+    "core/src/fxcrt/fx_system_unittest.cpp",
     "testing/fx_string_testhelpers.cpp",
     "testing/fx_string_testhelpers.h",
+    "third_party/base/nonstd_unique_ptr_unittest.cpp",
   ]
   deps = [
     "//testing/gtest",
@@ -798,6 +766,7 @@ test("pdfium_embeddertests") {
     "fpdfsdk/src/fpdfview_c_api_test.c",
     "fpdfsdk/src/fpdfview_c_api_test.h",
     "fpdfsdk/src/fpdfview_embeddertest.cpp",
+    "fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp",
     "testing/embedder_test.cpp",
     "testing/embedder_test.h",
     "testing/embedder_test_mock_delegate.h",
@@ -808,6 +777,7 @@ test("pdfium_embeddertests") {
   deps = [
     "//testing/gmock",
     "//testing/gtest",
+    "//v8",
     "//v8:v8_libplatform",
     ":pdfium",
   ]