refactor gyp to isolate freetype usage

R=bungeman@google.com

Review URL: https://codereview.chromium.org/19835002

git-svn-id: http://skia.googlecode.com/svn/trunk@10229 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
djsollen@google.com 2013-07-22 14:12:56 +00:00
Родитель 02dd688d61
Коммит 2679ff8b8d
5 изменённых файлов: 47 добавлений и 46 удалений

Просмотреть файл

@ -240,10 +240,6 @@
'-pthread',
],
},
}, { # skia_os != "nacl"
'include_dirs' : [
'/usr/include/freetype2',
],
}],
[ 'skia_os == "chromeos"', {
'ldflags': [

Просмотреть файл

@ -39,7 +39,6 @@
[ 'skia_os == "mac"', {
'include_dirs': [
'../include/utils/mac',
'../third_party/freetype/include/**',
],
'sources': [
'../include/utils/mac/SkCGUtils.h',
@ -110,7 +109,6 @@
[ 'skia_os == "mac"', {
'include_dirs': [
'../include/utils/mac',
'../third_party/freetype/include/**',
],
}],
[ 'skia_os == "ios"', {

Просмотреть файл

@ -2,6 +2,44 @@
'targets': [
{
'target_name': 'freetype',
'type': 'none',
'conditions': [
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]', {
'direct_dependent_settings': {
'include_dirs' : [
'/usr/include/freetype2',
],
'link_settings': {
'libraries': [
'-lfreetype',
],
'defines': [
#The font host requires at least FreeType 2.3.0 at runtime.
'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020300',\
'SK_CAN_USE_DLOPEN=1',
],
}
},
}],
[ 'skia_os in ["android", "nacl"]', {
'dependencies': [
'freetype_static'
],
'export_dependent_settings': [
'freetype_static'
],
'direct_dependent_settings': {
'defines': [
# Both Android and NaCl provide at least FreeType 2.4.0
'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400',
'SK_CAN_USE_DLOPEN=0',
],
},
}],
],
},
{
'target_name': 'freetype_static',
'type': 'static_library',
'standalone_static_library': 1,
'sources': [

Просмотреть файл

@ -43,44 +43,30 @@
'../src/ports/SkXMLParser_empty.cpp',
],
'conditions': [
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]', {
'defines': [
#The font host requires at least FreeType 2.3.0 at runtime.
'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020300',\
'SK_CAN_USE_DLOPEN=1',
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos", "nacl", "android"]', {
'sources': [
'../src/ports/SkFontHost_FreeType.cpp',
'../src/ports/SkFontHost_FreeType_common.cpp',
],
'dependencies': [
'freetype.gyp:freetype',
],
}],
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]', {
'link_settings': {
'libraries': [
'-lfreetype',
'-lfontconfig',
'-ldl',
],
},
'sources': [
'../src/fonts/SkFontMgr_fontconfig.cpp',
'../src/ports/SkFontHost_FreeType.cpp',
'../src/ports/SkFontHost_FreeType_common.cpp',
'../src/ports/SkFontHost_fontconfig.cpp',
'../src/ports/SkFontConfigInterface_direct.cpp',
],
}],
[ 'skia_os == "nacl"', {
'dependencies': [
# On other OS, we can dynamically link against freetype. For nacl,
# we have to include our own version since the naclports version is
# too old (<0x020300) to provide the functionality we need.
'freetype.gyp:freetype',
],
'export_dependent_settings': [
'freetype.gyp:freetype',
],
'defines': [
# We use Android's repo, which provides at least FreeType 2.4.0
'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400',\
],
'sources': [
'../src/ports/SkFontHost_FreeType.cpp',
'../src/ports/SkFontHost_FreeType_common.cpp',
'../src/ports/SkFontHost_linux.cpp',
],
'sources!': [
@ -94,12 +80,9 @@
[ 'skia_os == "mac"', {
'include_dirs': [
'../include/utils/mac',
'../third_party/freetype/include/**',
],
'sources': [
'../src/ports/SkFontHost_mac.cpp',
# '../src/ports/SkFontHost_FreeType.cpp',
# '../src/ports/SkFontHost_FreeType_common.cpp',
'../src/ports/SkPurgeableMemoryBlock_mac.cpp',
'../src/utils/mac/SkStream_mac.cpp',
],
@ -158,12 +141,6 @@
],
}],
[ 'skia_os == "android"', {
'defines': [
#Android provides at least FreeType 2.4.0 at runtime.
'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400',
#Skia should not use dlopen on Android.
'SK_CAN_USE_DLOPEN=0',
],
'sources!': [
'../src/ports/SkDebug_stdio.cpp',
'../src/ports/SkPurgeableMemoryBlock_none.cpp',
@ -172,13 +149,10 @@
'../src/ports/SkDebug_android.cpp',
'../src/ports/SkFontConfigInterface_android.cpp',
'../src/ports/SkFontConfigParser_android.cpp',
'../src/ports/SkFontHost_FreeType.cpp',
'../src/ports/SkFontHost_FreeType_common.cpp',
'../src/ports/SkFontHost_fontconfig.cpp',
'../src/ports/SkPurgeableMemoryBlock_android.cpp',
],
'dependencies': [
'freetype.gyp:freetype',
'android_deps.gyp:expat',
],
}],

Просмотреть файл

@ -27,11 +27,6 @@
'gpu.gyp:skgpu',
],
}],
[ 'skia_os == "nacl"', {
'component_libs': [
'freetype.gyp:freetype',
],
}],
],
},
'targets': [