# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+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",
deps = [
"third_party:bigint",
- "third_party:freetype",
- "third_party:safemath",
+ "third_party:pdfium_base",
":fdrm",
":formfiller",
":fpdfapi",
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.
"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",
"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",
"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",
public_deps = [
"//v8",
]
- deps = [
- "//v8:v8_libplatform",
- ]
}
static_library("jsapi") {
configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ]
}
-executable("pdfium_unittests") {
- testonly = true
+test("pdfium_unittests") {
sources = [
"core/src/fxcrt/fx_basic_bstring_unittest.cpp",
+ "core/src/fxcrt/fx_basic_wstring_unittest.cpp",
+ "testing/fx_string_testhelpers.cpp",
+ "testing/fx_string_testhelpers.h",
+ ]
+ deps = [
+ "//testing/gtest",
+ "//testing/gtest:gtest_main",
+ ":pdfium"
+ ]
+ include_dirs = [ "." ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ]
+}
+
+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",
+ "testing/fx_string_testhelpers.cpp",
+ "testing/fx_string_testhelpers.h",
]
deps = [
- ":pdfium",
- "//base",
- "//base/test:run_all_unittests",
"//testing/gtest",
+ ":pdfium"
]
+ include_dirs = [ "." ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ ":pdfium_config", "//build/config/compiler:no_chromium_code" ]
}