(Reland) Switch builds to clang by default for Linux and OS X.
[pdfium.git] / BUILD.gn
index 8ae5a08..e563e87 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -133,6 +133,39 @@ 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 -= [ "//build/config/compiler:chromium_code" ]
+  configs += [
+    ":pdfium_config",
+    "//build/config/compiler:no_chromium_code",
+  ]
+}
+
 # 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 = [
@@ -698,11 +731,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,11 +741,9 @@ 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 += [
@@ -731,14 +760,13 @@ 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" ]
@@ -763,13 +791,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 = [
     "."