Commit e30ecdc9 authored by drott's avatar drott Committed by Commit bot

Move FreeType bundling on mac OS from PDFium up to Chrome

Preparation for using FreeType on older mac OS versions for supporting
OpenType variable fonts.

Introduce a MAC_RESTRICT_VISIBILITY define in the FreeType build in
order not to expose FreeType symbols on the main executable on Mac,
since there is a symbol visibility check build-step which breaks if it
finds FreeType symbols there.

BUG=714553

Review-Url: https://codereview.chromium.org/2842513004
Cr-Commit-Position: refs/heads/master@{#467593}
parent 67b9f6e7
...@@ -138,6 +138,9 @@ deps = { ...@@ -138,6 +138,9 @@ deps = {
'src/testing/gmock': 'src/testing/gmock':
Var('chromium_git') + '/external/googlemock.git' + '@' + '0421b6f358139f02e102c9c332ce19a33faf75be', # from svn revision 566 Var('chromium_git') + '/external/googlemock.git' + '@' + '0421b6f358139f02e102c9c332ce19a33faf75be', # from svn revision 566
'src/third_party/freetype/src':
Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + Var('freetype_revision'),
'src/third_party/glslang/src': 'src/third_party/glslang/src':
Var('chromium_git') + '/external/github.com/google/glslang.git' + '@' + '210c6bf4d8119dc5f8ac21da2d4c87184f7015e0', Var('chromium_git') + '/external/github.com/google/glslang.git' + '@' + '210c6bf4d8119dc5f8ac21da2d4c87184f7015e0',
...@@ -315,9 +318,6 @@ deps = { ...@@ -315,9 +318,6 @@ deps = {
deps_os = { deps_os = {
'win': { 'win': {
'src/third_party/freetype/src':
Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + Var('freetype_revision'),
'src/third_party/cygwin': 'src/third_party/cygwin':
Var('chromium_git') + '/chromium/deps/cygwin.git' + '@' + 'c89e446b273697fadf3a10ff1007a97c0b7de6df', Var('chromium_git') + '/chromium/deps/cygwin.git' + '@' + 'c89e446b273697fadf3a10ff1007a97c0b7de6df',
...@@ -390,9 +390,6 @@ deps_os = { ...@@ -390,9 +390,6 @@ deps_os = {
'src/chrome/installer/mac/third_party/xz/xz': 'src/chrome/installer/mac/third_party/xz/xz':
Var('chromium_git') + '/chromium/deps/xz.git' + '@' + 'eecaf55632ca72e90eb2641376bce7cdbc7284f7', Var('chromium_git') + '/chromium/deps/xz.git' + '@' + 'eecaf55632ca72e90eb2641376bce7cdbc7284f7',
'src/third_party/freetype/src':
Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + Var('freetype_revision'),
'src/third_party/google_toolbox_for_mac/src': 'src/third_party/google_toolbox_for_mac/src':
Var('chromium_git') + '/external/github.com/google/google-toolbox-for-mac.git' + '@' + Var('google_toolbox_for_mac_revision'), Var('chromium_git') + '/external/github.com/google/google-toolbox-for-mac.git' + '@' + Var('google_toolbox_for_mac_revision'),
...@@ -411,9 +408,6 @@ deps_os = { ...@@ -411,9 +408,6 @@ deps_os = {
'src/third_party/cros_system_api': 'src/third_party/cros_system_api':
Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + 'c6eab9e4d0b4f56176df23d30b815dc94b774a3d', Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + 'c6eab9e4d0b4f56176df23d30b815dc94b774a3d',
'src/third_party/freetype/src':
Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + Var('freetype_revision'),
# Build tools for Chrome OS. Note: This depends on third_party/pyelftools. # Build tools for Chrome OS. Note: This depends on third_party/pyelftools.
'src/third_party/chromite': 'src/third_party/chromite':
Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '8dbd2c59b33e12575b4d8e808d440863060c2fc7', Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '8dbd2c59b33e12575b4d8e808d440863060c2fc7',
...@@ -477,9 +471,6 @@ deps_os = { ...@@ -477,9 +471,6 @@ deps_os = {
'src/third_party/findbugs': 'src/third_party/findbugs':
Var('chromium_git') + '/chromium/deps/findbugs.git' + '@' + '57f05238d3ac77ea0a194813d3065dd780c6e566', Var('chromium_git') + '/chromium/deps/findbugs.git' + '@' + '57f05238d3ac77ea0a194813d3065dd780c6e566',
'src/third_party/freetype/src':
Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + Var('freetype_revision'),
'src/third_party/elfutils/src': 'src/third_party/elfutils/src':
Var('chromium_git') + '/external/elfutils.git' + '@' + '249673729a7e5dbd5de4f3760bdcaa3d23d154d7', Var('chromium_git') + '/external/elfutils.git' + '@' + '249673729a7e5dbd5de4f3760bdcaa3d23d154d7',
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
import("//build/config/features.gni") import("//build/config/features.gni")
group("freetype") { group("freetype") {
if (is_chromecast || is_android || is_win) { if (is_linux && !is_chromecast) {
public_configs = [ "//build/linux:freetype_from_pkgconfig" ]
} else {
public_deps = [ public_deps = [
"//third_party/freetype", "//third_party/freetype",
] ]
} else if (is_linux) {
public_configs = [ "//build/linux:freetype_from_pkgconfig" ]
} }
} }
...@@ -10,7 +10,7 @@ pdf_enable_xfa_override = false ...@@ -10,7 +10,7 @@ pdf_enable_xfa_override = false
# Build PDFium either using the bundled FreeType, or using a third-party # Build PDFium either using the bundled FreeType, or using a third-party
# FreeType, configured by the embedder in //build/config/freetype. # FreeType, configured by the embedder in //build/config/freetype.
pdf_bundle_freetype_override = !is_linux && !is_win pdf_bundle_freetype_override = false
# Disable use of Skia backend. # Disable use of Skia backend.
pdf_use_skia_override = false pdf_use_skia_override = false
......
...@@ -87,6 +87,10 @@ component("freetype") { ...@@ -87,6 +87,10 @@ component("freetype") {
sources += [ "src/src/base/ftsynth.c" ] sources += [ "src/src/base/ftsynth.c" ]
} }
if (is_mac && !is_component_build) {
defines += [ "MAC_RESTRICT_VISIBILITY" ]
}
defines += [ defines += [
"FT2_BUILD_LIBRARY", "FT2_BUILD_LIBRARY",
"DARWIN_NO_CARBON", "DARWIN_NO_CARBON",
......
...@@ -323,8 +323,13 @@ FT_BEGIN_HEADER ...@@ -323,8 +323,13 @@ FT_BEGIN_HEADER
#endif #endif
#else #else
#if !defined(MAC_RESTRICT_VISIBILITY)
#define FT_EXPORT(x) __attribute__((visibility ("default"))) x #define FT_EXPORT(x) __attribute__((visibility ("default"))) x
#define FT_EXPORT_DEF(x) __attribute__((visibility ("default"))) x #define FT_EXPORT_DEF(x) __attribute__((visibility ("default"))) x
#else
#define FT_EXPORT(x) x
#define FT_EXPORT_DEF(x) x
#endif
#endif #endif
/*************************************************************************/ /*************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment