Allow Android font manager on *nix.
There is nothing left in the SkFontMgr_android.cpp which is specific
to Android, so allow it to be built and used on *nix platforms. This
allows for easier development and testing.
The only reason to limit to *nix platforms are the dependencies on
Expat and FreeType. This should be buildable and runnable on other
platforms when these dependencies are also available.
Review URL: https://codereview.chromium.org/1228833003
diff --git a/gyp/ports.gyp b/gyp/ports.gyp
index a0cfbd6..9d63d55 100644
--- a/gyp/ports.gyp
+++ b/gyp/ports.gyp
@@ -77,29 +77,33 @@
'sources': [
'../src/ports/SkFontHost_FreeType.cpp',
'../src/ports/SkFontHost_FreeType_common.cpp',
+ '../src/ports/SkFontMgr_android.cpp',
+ '../src/ports/SkFontMgr_android_parser.cpp',
+ '../src/ports/SkFontMgr_custom.cpp',
],
'dependencies': [
'freetype.gyp:freetype',
],
- }],
- [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]', {
'conditions': [
- [ 'skia_embedded_fonts', {
+ [ 'skia_os == "android"', {
+ 'dependencies': [
+ 'android_deps.gyp:expat',
+ ],
+ }, {
'link_settings': {
'libraries': [
'-ldl',
+ '-lexpat',
],
},
+ }],
+ [ 'skia_embedded_fonts', {
'variables': {
'embedded_font_data_identifier': 'sk_fonts',
'fonts_to_include': [
'../resources/fonts/Funkster.ttf',
],
},
- 'sources': [
- '../include/ports/SkFontMgr_custom.h',
- '../src/ports/SkFontMgr_custom.cpp',
- ],
'sources/': [['include', '../src/ports/SkFontMgr_custom_embedded_factory.cpp']],
'actions': [{
'action_name': 'generate_embedded_font_data',
@@ -123,21 +127,13 @@
'SK_EMBEDDED_FONTS=<(embedded_font_data_identifier)',
],
}, 'skia_no_fontconfig', {
- 'link_settings': {
- 'libraries': [
- '-ldl',
- ],
- },
- 'sources': [
- '../include/ports/SkFontMgr_custom.h',
- '../src/ports/SkFontMgr_custom.cpp',
- ],
'sources/': [['include', '../src/ports/SkFontMgr_custom_directory_factory.cpp']],
+ }, 'skia_os == "android"', {
+ 'sources/': [['include', '../src/ports/SkFontMgr_android_factory.cpp']],
}, {
'link_settings': {
'libraries': [
'-lfontconfig',
- '-ldl',
],
},
'sources': [
@@ -157,9 +153,6 @@
'../src/ports/SkFontHost_mac.cpp',
'../src/utils/mac/SkStream_mac.cpp',
],
- 'sources!': [
- '../src/ports/SkFontHost_tables.cpp',
- ],
}],
[ 'skia_os == "ios"', {
'include_dirs': [
@@ -170,9 +163,6 @@
'../src/ports/SkFontHost_mac.cpp',
'../src/utils/mac/SkStream_mac.cpp',
],
- 'sources!': [
- '../src/ports/SkFontHost_tables.cpp',
- ],
}],
[ 'skia_os == "win"', {
'include_dirs': [
@@ -214,12 +204,6 @@
],
'sources': [
'../src/ports/SkDebug_android.cpp',
- '../src/ports/SkFontMgr_android.cpp',
- '../src/ports/SkFontMgr_android_parser.cpp',
- ],
- 'sources/': [['include', '../src/ports/SkFontMgr_android_factory.cpp']],
- 'dependencies': [
- 'android_deps.gyp:expat',
],
}],
],
diff --git a/gyp/tests.gypi b/gyp/tests.gypi
index ea332bf..e2de604 100644
--- a/gyp/tests.gypi
+++ b/gyp/tests.gypi
@@ -13,6 +13,7 @@
'../src/images',
'../src/pathops',
'../src/pdf',
+ '../src/ports',
'../src/pipe/utils',
'../src/utils',
'../src/utils/debugger',
@@ -31,13 +32,9 @@
'tools.gyp:sk_tool_utils',
],
'conditions': [
- [ 'skia_os == "android"',
- {
- 'include_dirs': [ '../src/ports', ],
- }, {
+ [ 'skia_os not in ["linux", "freebsd", "openbsd", "solaris", "chromeos", "android"]', {
'sources!': [ '../tests/FontMgrAndroidParserTest.cpp', ],
- }
- ],
+ }],
[ 'skia_android_framework == 1', {
'libraries': [
'-ldl',