summaryrefslogtreecommitdiff
path: root/pdfium.gyp
diff options
context:
space:
mode:
authorJohn Abd-El-Malek <jam@chromium.org>2015-01-30 16:55:08 -0800
committerJohn Abd-El-Malek <jam@chromium.org>2015-01-30 16:55:08 -0800
commit71c24b839498fb89184002ed30fcff353e1e402c (patch)
treec83e6b8231a550b00c0c20de290739e6ff35619c /pdfium.gyp
parentb38a900497ab85c5badd5f1cd1f8c00d0c6f580d (diff)
downloadpdfium-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 'pdfium.gyp')
-rw-r--r--pdfium.gyp36
1 files changed, 31 insertions, 5 deletions
diff --git a/pdfium.gyp b/pdfium.gyp
index cbdf4b70ac..8b13321ab9 100644
--- a/pdfium.gyp
+++ b/pdfium.gyp
@@ -1,21 +1,37 @@
{
'variables': {
'pdf_use_skia%': 0,
+ 'conditions': [
+ ['OS=="linux"', {
+ 'bundle_freetype%': 0,
+ }, { # On Android there's no system FreeType. On Windows and Mac, only a
+ # few methods are used from it.
+ 'bundle_freetype%': 1,
+ }],
+ ],
},
'target_defaults': {
'defines' : [
- 'FT2_BUILD_LIBRARY',
'_FPDFSDK_LIB',
'_NO_GDIPLUS_', # workaround text rendering issues on Windows
'OPJ_STATIC',
],
- 'include_dirs': [
- 'third_party/freetype/include',
- ],
'conditions': [
['pdf_use_skia==1', {
'defines': ['_SKIA_SUPPORT_'],
}],
+ ['bundle_freetype==1', {
+ 'include_dirs': [
+ 'third_party/freetype/include',
+ ],
+ 'defines' : [
+ 'FT2_BUILD_LIBRARY',
+ ],
+ }, {
+ 'include_dirs' : [
+ '/usr/include/freetype2',
+ ],
+ }],
['OS=="linux"', {
'conditions': [
['target_arch=="x64"', {
@@ -38,7 +54,6 @@
'type': 'static_library',
'dependencies': [
'third_party/third_party.gyp:bigint',
- 'third_party/third_party.gyp:freetype',
'third_party/third_party.gyp:safemath',
'fdrm',
'fpdfdoc',
@@ -102,6 +117,17 @@
'fpdfsdk/src/fpdfsdkdll.rc',
],
}],
+ ['bundle_freetype==1', {
+ 'dependencies': [
+ 'third_party/third_party.gyp:freetype',
+ ],
+ }, {
+ 'link_settings': {
+ 'libraries': [
+ '-lfreetype',
+ ],
+ },
+ }],
],
'all_dependent_settings': {
'msvs_settings': {