Index: BUILD.gn |
diff --git a/BUILD.gn b/BUILD.gn |
index 4e3a00d03a84a712098ddba9f592d50c9c6e4f91..761e1522e27214345cb41f5d42b9fc844c4c850a 100644 |
--- a/BUILD.gn |
+++ b/BUILD.gn |
@@ -6,15 +6,19 @@ 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", |
] |
if (pdf_use_skia) { |
@@ -91,7 +95,6 @@ static_library("pdfium") { |
deps = [ |
"third_party:bigint", |
- "third_party:freetype", |
"third_party:safemath", |
":fdrm", |
":formfiller", |
@@ -116,6 +119,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. |