Merge to master: Restore early return in FORM_DoPageAAction()
[pdfium.git] / BUILD.gn
index 8ae5a08..120abc2 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -38,8 +38,21 @@ config("pdfium_config") {
       "/wd4146",
       "/wd4333",
       "/wd4345",
+      # TODO(thestig): Fix all instances, remove this, pdfium:29
+      "/wd4245",
+      "/wd4310",
+      "/wd4389",
+      "/wd4701",
+      "/wd4702",
+      "/wd4706",
+      "/wd4800",
     ]
   }
+
+  if (is_clang) {
+    # TODO(thestig): Fix all instances, remove this, pdfium:29
+    cflags += [ "-Wno-sign-compare" ]
+  }
 }
 
 static_library("pdfium") {
@@ -61,7 +74,6 @@ static_library("pdfium") {
     "fpdfsdk/src/fpdfformfill.cpp",
     "fpdfsdk/src/fpdfppo.cpp",
     "fpdfsdk/src/fpdfsave.cpp",
-    "fpdfsdk/src/fpdfsdkdll.rc",
     "fpdfsdk/src/fpdftext.cpp",
     "fpdfsdk/src/fpdfview.cpp",
     "fpdfsdk/src/fsdk_actionhandler.cpp",
@@ -70,7 +82,6 @@ static_library("pdfium") {
     "fpdfsdk/src/fsdk_baseform.cpp",
     "fpdfsdk/src/fsdk_mgr.cpp",
     "fpdfsdk/src/fsdk_rendercontext.cpp",
-    "fpdfsdk/src/resource.h",
     "public/fpdf_dataavail.h",
     "public/fpdf_doc.h",
     "public/fpdf_edit.h",
@@ -89,11 +100,7 @@ static_library("pdfium") {
   ]
 
   libs = []
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 
   deps = [
     "third_party:bigint",
@@ -133,6 +140,35 @@ static_library("pdfium") {
   }
 }
 
+source_set("test_support") {
+  testonly = true
+  sources = [
+    "testing/fx_string_testhelpers.cpp",
+    "testing/fx_string_testhelpers.h",
+    "testing/test_support.cpp",
+    "testing/test_support.h",
+  ]
+  deps = [
+    "//testing/gmock",
+    "//testing/gtest",
+    ":pdfium",
+  ]
+  include_dirs = [
+    "."
+  ]
+  if (pdf_enable_v8) {
+    deps += [
+      "//v8",
+      "//v8:v8_libplatform",
+    ]
+    include_dirs += [
+      "//v8",
+      "//v8/include",
+    ]
+  }
+  configs += [ ":pdfium_config" ]
+}
+
 # Targets below this are only visible within this file (and to the
 # top-level gn_visibility target used to help gn_all build everything).
 visibility = [
@@ -147,11 +183,7 @@ static_library("fdrm") {
     "core/src/fdrm/crypto/fx_crypt_aes.cpp",
     "core/src/fdrm/crypto/fx_crypt_sha.cpp",
   ]
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }
 
 static_library("fpdfdoc") {
@@ -180,11 +212,7 @@ static_library("fpdfdoc") {
     "core/src/fpdfdoc/pdf_vt.h",
     "core/src/fpdfdoc/tagged_int.h",
   ]
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }
 
 static_library("fpdfapi") {
@@ -300,11 +328,7 @@ static_library("fpdfapi") {
     "core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp",
     "core/src/fpdfapi/fpdf_render/render_int.h",
   ]
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }
 
 static_library("fpdftext") {
@@ -319,11 +343,7 @@ static_library("fpdftext") {
     "core/src/fpdftext/unicodenormalizationdata.cpp",
     "core/src/fpdftext/unicodenormalizationdata.h",
   ]
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }
 
 static_library("fxcodec") {
@@ -386,17 +406,13 @@ static_library("fxcodec") {
     "core/src/fxcodec/jbig2/JBig2_TrdProc.cpp",
     "core/src/fxcodec/jbig2/JBig2_TrdProc.h",
   ]
-  configs -= [ "//build/config/compiler:chromium_code" ]
 
   if (is_posix) {
     # core/src/fxcodec/fx_libopenjpeg/src/fx_mct.c does an pointer-to-int
     # conversion to check that an address is 16-bit aligned (benign).
     cflags_c = [ "-Wno-pointer-to-int-cast" ]
   }
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }
 
 config("fxge_warnings") {
@@ -449,11 +465,7 @@ static_library("fxcrt") {
     "core/src/fxcrt/plex.h",
     "core/src/fxcrt/xml_int.h",
   ]
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }
 
 static_library("fxge") {
@@ -519,11 +531,9 @@ static_library("fxge") {
     "core/src/fxge/ge/text_int.h",
   ]
 
-  configs -= [ "//build/config/compiler:chromium_code" ]
   configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
     ":fxge_warnings",
+    ":pdfium_config",
   ]
 
   if (pdf_use_skia) {
@@ -541,9 +551,7 @@ static_library("fxge") {
       "//third_party/skia/include/utils",
       "//third_party/skia/src/core",
     ]
-    deps = [
-      "//skia",
-    ]
+    deps = [ "//skia" ]
   }
 
   if (is_win) {
@@ -572,11 +580,7 @@ static_library("fxedit") {
     "fpdfsdk/src/fxedit/fxet_module.cpp",
     "fpdfsdk/src/fxedit/fxet_pageobjs.cpp",
   ]
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }
 
 static_library("pdfwindow") {
@@ -618,11 +622,7 @@ static_library("pdfwindow") {
     "fpdfsdk/src/pdfwindow/PWL_Utils.cpp",
     "fpdfsdk/src/pdfwindow/PWL_Wnd.cpp",
   ]
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }
 
 static_library("javascript") {
@@ -683,11 +683,7 @@ static_library("javascript") {
   } else {
     sources += [ "fpdfsdk/src/javascript/JS_Runtime_Stub.cpp" ]
   }
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }
 
 static_library("formfiller") {
@@ -698,11 +694,9 @@ static_library("formfiller") {
     "fpdfsdk/include/formfiller/FFL_FormFiller.h",
     "fpdfsdk/include/formfiller/FFL_IFormFiller.h",
     "fpdfsdk/include/formfiller/FFL_ListBox.h",
-    "fpdfsdk/include/formfiller/FFL_Notify.h",
     "fpdfsdk/include/formfiller/FFL_PushButton.h",
     "fpdfsdk/include/formfiller/FFL_RadioButton.h",
     "fpdfsdk/include/formfiller/FFL_TextField.h",
-    "fpdfsdk/include/formfiller/FFL_Utils.h",
     "fpdfsdk/include/formfiller/FormFiller.h",
     "fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp",
     "fpdfsdk/src/formfiller/FFL_CheckBox.cpp",
@@ -710,17 +704,11 @@ static_library("formfiller") {
     "fpdfsdk/src/formfiller/FFL_FormFiller.cpp",
     "fpdfsdk/src/formfiller/FFL_IFormFiller.cpp",
     "fpdfsdk/src/formfiller/FFL_ListBox.cpp",
-    "fpdfsdk/src/formfiller/FFL_Notify.cpp",
     "fpdfsdk/src/formfiller/FFL_PushButton.cpp",
     "fpdfsdk/src/formfiller/FFL_RadioButton.cpp",
     "fpdfsdk/src/formfiller/FFL_TextField.cpp",
-    "fpdfsdk/src/formfiller/FFL_Utils.cpp",
-  ]
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
   ]
+  configs += [ ":pdfium_config" ]
 }
 
 test("pdfium_unittests") {
@@ -731,27 +719,23 @@ test("pdfium_unittests") {
     "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",
     "//testing/gtest:gtest_main",
     ":pdfium",
+    ":test_support",
   ]
   include_dirs = [ "." ]
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }
 
 test("pdfium_embeddertests") {
   sources = [
     "core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp",
     "core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp",
+    "core/src/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp",
     "fpdfsdk/src/fpdf_dataavail_embeddertest.cpp",
     "fpdfsdk/src/fpdfdoc_embeddertest.cpp",
     "fpdfsdk/src/fpdfformfill_embeddertest.cpp",
@@ -763,13 +747,12 @@ test("pdfium_embeddertests") {
     "testing/embedder_test.h",
     "testing/embedder_test_mock_delegate.h",
     "testing/embedder_test_timer_handling_delegate.h",
-    "testing/fx_string_testhelpers.cpp",
-    "testing/fx_string_testhelpers.h",
   ]
   deps = [
     "//testing/gmock",
     "//testing/gtest",
     ":pdfium",
+    ":test_support",
   ]
   include_dirs = [
     "."
@@ -787,9 +770,5 @@ test("pdfium_embeddertests") {
       "//v8/include",
     ]
   }
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [
-    ":pdfium_config",
-    "//build/config/compiler:no_chromium_code",
-  ]
+  configs += [ ":pdfium_config" ]
 }