diff options
author | John Abd-El-Malek <jam@chromium.org> | 2015-01-30 16:55:08 -0800 |
---|---|---|
committer | John Abd-El-Malek <jam@chromium.org> | 2015-01-30 16:55:08 -0800 |
commit | 71c24b839498fb89184002ed30fcff353e1e402c (patch) | |
tree | c83e6b8231a550b00c0c20de290739e6ff35619c /BUILD.gn | |
parent | b38a900497ab85c5badd5f1cd1f8c00d0c6f580d (diff) | |
download | pdfium-71c24b839498fb89184002ed30fcff353e1e402c.tar.xz |
Use system FreeType on Linux.
This saves 406KB in the binary size of the plugin. More importantly, it gets rid of the linker flag preventing bundling PDFium into the Chromium binary.
BUG=453844
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/826613004
Diffstat (limited to 'BUILD.gn')
-rw-r--r-- | BUILD.gn | 24 |
1 files changed, 19 insertions, 5 deletions
@@ -6,13 +6,15 @@ 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" - ] defines = [ - "FT2_BUILD_LIBRARY", "_FPDFSDK_LIB", "_NO_GDIPLUS_", # workaround text rendering issues on Windows "OPJ_STATIC", @@ -40,6 +42,13 @@ config("pdfium_config") { "/wd4345", ] } + + if (bundle_freetype) { + include_dirs = [ "third_party/freetype/include" ] + defines += [ "FT2_BUILD_LIBRARY" ] + } else { + include_dirs = [ "/usr/include/freetype2" ] + } } static_library("pdfium") { @@ -92,7 +101,6 @@ static_library("pdfium") { deps = [ "third_party:bigint", - "third_party:freetype", "third_party:safemath", ":fdrm", ":formfiller", @@ -115,6 +123,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. |