1 # Copyright 2015 Google Inc. 2 # 3 # Use of this source code is governed by a BSD-style license that can be 4 # found in the LICENSE file. 5 # Port-specific Skia library code. 6 { 7 'targets': [ 8 { 9 'target_name': 'ports', 10 'product_name': 'skia_ports', 11 'type': 'static_library', 12 'standalone_static_library': 1, 13 'dependencies': [ 14 'core.gyp:*', 15 ], 16 'include_dirs': [ 17 '../include/effects', 18 '../include/client/android', 19 '../include/images', 20 '../include/ports', 21 '../include/private', 22 '../include/utils', 23 '../include/utils/win', 24 '../src/core', 25 '../src/image', 26 '../src/lazy', 27 '../src/ports', 28 '../src/sfnt', 29 '../src/utils', 30 ], 31 'sources': [ 32 '../src/ports/SkDebug_stdio.cpp', 33 '../src/ports/SkDebug_win.cpp', 34 35 '../src/fonts/SkFontMgr_indirect.cpp', 36 '../src/fonts/SkRemotableFontMgr.cpp', 37 '../src/ports/SkFontHost_win.cpp', 38 '../src/ports/SkFontMgr_android_factory.cpp', 39 '../src/ports/SkFontMgr_custom_directory_factory.cpp', 40 '../src/ports/SkFontMgr_custom_embedded_factory.cpp', 41 '../src/ports/SkFontMgr_fontconfig_factory.cpp', 42 '../src/ports/SkFontMgr_win_dw.cpp', 43 '../src/ports/SkFontMgr_win_dw_factory.cpp', 44 '../src/ports/SkFontMgr_win_gdi_factory.cpp', 45 '../src/ports/SkRemotableFontMgr_win_dw.cpp', 46 '../src/ports/SkScalerContext_win_dw.cpp', 47 '../src/ports/SkScalerContext_win_dw.h', 48 '../src/ports/SkTypeface_win_dw.cpp', 49 '../src/ports/SkTypeface_win_dw.h', 50 51 '../src/ports/SkGlobalInitialization_default.cpp', 52 '../src/ports/SkMemory_malloc.cpp', 53 '../src/ports/SkOSEnvironment.h', 54 '../src/ports/SkOSEnvironment.cpp', 55 '../src/ports/SkOSFile_posix.cpp', 56 '../src/ports/SkOSFile_stdio.cpp', 57 '../src/ports/SkOSFile_win.cpp', 58 '../src/ports/SkOSLibrary.h', 59 '../src/ports/SkOSLibrary_posix.cpp', 60 '../src/ports/SkOSLibrary_win.cpp', 61 '../src/ports/SkDiscardableMemory_none.cpp', 62 '../src/ports/SkTime_Unix.cpp', 63 '../src/ports/SkTime_win.cpp', 64 '../src/ports/SkTLS_pthread.cpp', 65 '../src/ports/SkTLS_win.cpp', 66 67 '../include/ports/SkFontConfigInterface.h', 68 '../include/ports/SkFontMgr.h', 69 '../include/ports/SkFontMgr_android.h', 70 '../include/ports/SkFontMgr_custom.h', 71 '../include/ports/SkFontMgr_fontconfig.h', 72 '../include/ports/SkFontMgr_indirect.h', 73 '../include/ports/SkRemotableFontMgr.h', 74 ], 75 'sources/': [ 76 ['exclude', 'SkFontMgr_.+_factory\\.cpp$'], 77 ], 78 'conditions': [ 79 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos", "android"]', { 80 'sources': [ 81 '../src/ports/SkFontHost_FreeType.cpp', 82 '../src/ports/SkFontHost_FreeType_common.cpp', 83 '../src/ports/SkFontMgr_android.cpp', 84 '../src/ports/SkFontMgr_android_parser.cpp', 85 '../src/ports/SkFontMgr_custom.cpp', 86 ], 87 'dependencies': [ 88 'freetype.gyp:freetype', 89 ], 90 'conditions': [ 91 [ 'skia_android_framework', { 92 'link_settings': { 'libraries': [ '-lexpat' ] }, 93 }, { 94 'link_settings': { 'libraries': [ '-ldl' ] }, 95 'dependencies': [ 'expat.gyp:expat' ], 96 }], 97 [ 'skia_embedded_fonts', { 98 'variables': { 99 'embedded_font_data_identifier': 'sk_fonts', 100 'fonts_to_include': [ 101 '../resources/fonts/Funkster.ttf', 102 ], 103 }, 104 'sources/': [['include', '../src/ports/SkFontMgr_custom_embedded_factory.cpp']], 105 'actions': [{ 106 'action_name': 'generate_embedded_font_data', 107 'inputs': [ 108 '../tools/embed_resources.py', 109 '<@(fonts_to_include)', 110 ], 111 'outputs': [ 112 '<(SHARED_INTERMEDIATE_DIR)/ports/fonts/fonts.cpp', 113 ], 114 'action': ['python', '../tools/embed_resources.py', 115 '--align', '4', 116 '--name', '<(embedded_font_data_identifier)', 117 '--input', '<@(fonts_to_include)', 118 '--output', '<@(_outputs)', 119 ], 120 'message': 'Generating <@(_outputs)', 121 'process_outputs_as_sources': 1, 122 }], 123 'defines': [ 124 'SK_EMBEDDED_FONTS=<(embedded_font_data_identifier)', 125 ], 126 }, 'skia_no_fontconfig', { 127 'sources/': [['include', '../src/ports/SkFontMgr_custom_directory_factory.cpp']], 128 }, 'skia_os == "android"', { 129 'sources/': [['include', '../src/ports/SkFontMgr_android_factory.cpp']], 130 }, { 131 'link_settings': { 132 'libraries': [ 133 '-lfontconfig', 134 ], 135 }, 136 'sources': [ 137 '../src/ports/SkFontMgr_fontconfig.cpp', 138 '../src/ports/SkFontHost_fontconfig.cpp', 139 '../src/ports/SkFontConfigInterface_direct.cpp', 140 '../src/ports/SkFontConfigInterface_direct_factory.cpp', 141 ], 142 'sources/': [['include', '../src/ports/SkFontMgr_fontconfig_factory.cpp']], 143 }] 144 ], 145 }], 146 [ 'skia_os == "mac"', { 147 'include_dirs': [ 148 '../include/utils/mac', 149 ], 150 'sources': [ 151 '../src/ports/SkFontHost_mac.cpp', 152 '../src/utils/mac/SkStream_mac.cpp', 153 ], 154 }], 155 [ 'skia_os == "ios"', { 156 'include_dirs': [ 157 '../include/utils/ios', 158 '../include/utils/mac', 159 ], 160 'sources': [ 161 '../src/ports/SkFontHost_mac.cpp', 162 '../src/utils/mac/SkStream_mac.cpp', 163 ], 164 }], 165 [ 'skia_os == "win"', { 166 'include_dirs': [ 167 'config/win', 168 '../src/utils/win', 169 ], 170 'sources!': [ # these are used everywhere but windows 171 '../src/ports/SkDebug_stdio.cpp', 172 '../src/ports/SkOSFile_posix.cpp', 173 '../src/ports/SkOSLibrary_posix.cpp', 174 '../src/ports/SkTime_Unix.cpp', 175 '../src/ports/SkTLS_pthread.cpp', 176 ], 177 'conditions': [ 178 # when we build for win, we only want one of these default files 179 [ 'skia_gdi', { 180 'sources/': [['include', '../src/ports/SkFontMgr_win_gdi_factory.cpp']], 181 }, { # normally default to direct write 182 'sources/': [['include', '../src/ports/SkFontMgr_win_dw_factory.cpp']], 183 }], 184 ], 185 }, { # else !win 186 'sources!': [ 187 '../src/ports/SkDebug_win.cpp', 188 '../src/ports/SkFontHost_win.cpp', 189 '../src/ports/SkFontMgr_win_dw.cpp', 190 '../src/ports/SkOSFile_win.cpp', 191 '../src/ports/SkOSLibrary_win.cpp', 192 '../src/ports/SkRemotableFontMgr_win_dw.cpp', 193 '../src/ports/SkTime_win.cpp', 194 '../src/ports/SkTLS_win.cpp', 195 '../src/ports/SkScalerContext_win_dw.cpp', 196 '../src/ports/SkScalerContext_win_dw.h', 197 '../src/ports/SkTypeface_win_dw.cpp', 198 '../src/ports/SkTypeface_win_dw.h', 199 ], 200 }], 201 [ 'skia_os == "android"', { 202 'sources!': [ 203 '../src/ports/SkDebug_stdio.cpp', 204 ], 205 'sources': [ 206 '../src/ports/SkDebug_android.cpp', 207 ], 208 }], 209 ], 210 'direct_dependent_settings': { 211 'include_dirs': [ 212 '../include/ports', 213 ], 214 }, 215 }, 216 ], 217 } 218