blob: 35f5284c1859167ffd7f5627c72d3210206213ae [file] [log] [blame]
scroggo3e562272015-03-25 10:22:41 -07001# 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.
caryclark@google.comafcb55c2011-12-14 17:12:04 +00005# Port-specific Skia library code.
6{
caryclark@google.comafcb55c2011-12-14 17:12:04 +00007 'targets': [
8 {
9 'target_name': 'ports',
borenet@google.comefb1d772012-10-10 19:45:51 +000010 'product_name': 'skia_ports',
caryclark@google.comafcb55c2011-12-14 17:12:04 +000011 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000012 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +000013 'dependencies': [
14 'core.gyp:*',
15 ],
caryclark@google.comafcb55c2011-12-14 17:12:04 +000016 'include_dirs': [
bungeman@google.com5a64e582012-03-29 14:51:56 +000017 '../include/effects',
scroggo@google.comd9ef3a22013-03-15 18:08:09 +000018 '../include/images',
bungeman@google.com29b63dc2012-03-29 14:28:59 +000019 '../include/ports',
mtkleincd1f2da2015-07-28 08:55:14 -070020 '../include/private',
djsollen@google.com52f02972013-06-03 12:10:19 +000021 '../include/utils',
djsollen@google.com28979312013-06-03 14:44:52 +000022 '../include/utils/win',
caryclark@google.comafcb55c2011-12-14 17:12:04 +000023 '../src/core',
halcanaryba923d32015-12-07 12:02:33 -080024 '../src/image',
scroggo@google.comd9ef3a22013-03-15 18:08:09 +000025 '../src/lazy',
reed@google.come027a6e2013-07-31 17:37:31 +000026 '../src/ports',
djsollen@google.com52f02972013-06-03 12:10:19 +000027 '../src/sfnt',
bungeman@google.coma02bc152012-05-16 18:21:56 +000028 '../src/utils',
caryclark@google.comafcb55c2011-12-14 17:12:04 +000029 ],
30 'sources': [
31 '../src/ports/SkDebug_stdio.cpp',
32 '../src/ports/SkDebug_win.cpp',
bungeman@google.combfc6cc42013-08-21 15:20:43 +000033
bungeman@google.com72cf4fc2014-03-21 22:48:32 +000034 '../src/fonts/SkFontMgr_indirect.cpp',
35 '../src/fonts/SkRemotableFontMgr.cpp',
caryclark@google.comafcb55c2011-12-14 17:12:04 +000036 '../src/ports/SkFontHost_win.cpp',
bungeman77f85ad2015-06-17 12:07:10 -070037 '../src/ports/SkFontMgr_android_factory.cpp',
bungeman5cf19492015-06-15 15:17:21 -070038 '../src/ports/SkFontMgr_custom_directory_factory.cpp',
39 '../src/ports/SkFontMgr_custom_embedded_factory.cpp',
bungeman0b1de262015-06-17 07:55:59 -070040 '../src/ports/SkFontMgr_fontconfig_factory.cpp',
bungeman51daa252014-06-05 13:38:45 -070041 '../src/ports/SkFontMgr_win_dw.cpp',
bungeman5cf19492015-06-15 15:17:21 -070042 '../src/ports/SkFontMgr_win_dw_factory.cpp',
43 '../src/ports/SkFontMgr_win_gdi_factory.cpp',
bungeman@google.com72cf4fc2014-03-21 22:48:32 +000044 '../src/ports/SkRemotableFontMgr_win_dw.cpp',
Ben Wagner98875e12014-06-05 16:55:58 -040045 '../src/ports/SkScalerContext_win_dw.cpp',
bungeman51daa252014-06-05 13:38:45 -070046 '../src/ports/SkScalerContext_win_dw.h',
47 '../src/ports/SkTypeface_win_dw.cpp',
48 '../src/ports/SkTypeface_win_dw.h',
bungeman@google.combfc6cc42013-08-21 15:20:43 +000049
caryclark@google.comd26147a2011-12-15 14:16:43 +000050 '../src/ports/SkGlobalInitialization_default.cpp',
caryclark@google.comafcb55c2011-12-14 17:12:04 +000051 '../src/ports/SkMemory_malloc.cpp',
bungeman@google.com6cab1a42013-05-29 13:43:31 +000052 '../src/ports/SkOSFile_posix.cpp',
caryclark@google.comafcb55c2011-12-14 17:12:04 +000053 '../src/ports/SkOSFile_stdio.cpp',
bungeman@google.com6cab1a42013-05-29 13:43:31 +000054 '../src/ports/SkOSFile_win.cpp',
hendrikwb1ac52f2015-10-01 18:29:34 -070055 '../src/ports/SkOSLibrary.h',
56 '../src/ports/SkOSLibrary_posix.cpp',
57 '../src/ports/SkOSLibrary_win.cpp',
scroggo@google.com8b71ef12013-08-19 18:38:08 +000058 '../src/ports/SkDiscardableMemory_none.cpp',
caryclark@google.comafcb55c2011-12-14 17:12:04 +000059 '../src/ports/SkTime_Unix.cpp',
60 '../src/ports/SkTime_win.cpp',
bungeman@google.comf2e7dbb2013-07-16 14:59:24 +000061 '../src/ports/SkTLS_pthread.cpp',
62 '../src/ports/SkTLS_win.cpp',
bungeman@google.com72cf4fc2014-03-21 22:48:32 +000063
64 '../include/ports/SkFontConfigInterface.h',
65 '../include/ports/SkFontMgr.h',
bungeman77f85ad2015-06-17 12:07:10 -070066 '../include/ports/SkFontMgr_android.h',
bungeman0b1de262015-06-17 07:55:59 -070067 '../include/ports/SkFontMgr_custom.h',
68 '../include/ports/SkFontMgr_fontconfig.h',
bungeman@google.com72cf4fc2014-03-21 22:48:32 +000069 '../include/ports/SkFontMgr_indirect.h',
bungeman@google.com72cf4fc2014-03-21 22:48:32 +000070 '../include/ports/SkRemotableFontMgr.h',
caryclark@google.comafcb55c2011-12-14 17:12:04 +000071 ],
bungeman5cf19492015-06-15 15:17:21 -070072 'sources/': [
73 ['exclude', 'SkFontMgr_.+_factory\\.cpp$'],
74 ],
caryclark@google.comafcb55c2011-12-14 17:12:04 +000075 'conditions': [
borenet48087572015-04-02 12:16:36 -070076 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos", "android"]', {
djsollen@google.com2679ff82013-07-22 14:12:56 +000077 'sources': [
78 '../src/ports/SkFontHost_FreeType.cpp',
79 '../src/ports/SkFontHost_FreeType_common.cpp',
bungeman786ece12015-07-15 10:58:47 -070080 '../src/ports/SkFontMgr_android.cpp',
81 '../src/ports/SkFontMgr_android_parser.cpp',
82 '../src/ports/SkFontMgr_custom.cpp',
borenet@google.com7158e6a2012-11-01 17:43:44 +000083 ],
djsollen@google.com2679ff82013-07-22 14:12:56 +000084 'dependencies': [
85 'freetype.gyp:freetype',
86 ],
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +000087 'conditions': [
bungeman786ece12015-07-15 10:58:47 -070088 [ 'skia_os == "android"', {
89 'dependencies': [
90 'android_deps.gyp:expat',
91 ],
92 }, {
bungeman5c9fa282015-03-30 12:53:48 -070093 'link_settings': {
94 'libraries': [
95 '-ldl',
bungeman786ece12015-07-15 10:58:47 -070096 '-lexpat',
bungeman5c9fa282015-03-30 12:53:48 -070097 ],
98 },
bungeman786ece12015-07-15 10:58:47 -070099 }],
100 [ 'skia_embedded_fonts', {
bungeman5c9fa282015-03-30 12:53:48 -0700101 'variables': {
102 'embedded_font_data_identifier': 'sk_fonts',
103 'fonts_to_include': [
bungeman3ffa1262015-04-30 17:12:58 -0400104 '../resources/fonts/Funkster.ttf',
bungeman5c9fa282015-03-30 12:53:48 -0700105 ],
106 },
bungeman5cf19492015-06-15 15:17:21 -0700107 'sources/': [['include', '../src/ports/SkFontMgr_custom_embedded_factory.cpp']],
bungeman5c9fa282015-03-30 12:53:48 -0700108 'actions': [{
109 'action_name': 'generate_embedded_font_data',
110 'inputs': [
111 '../tools/embed_resources.py',
112 '<@(fonts_to_include)',
113 ],
114 'outputs': [
115 '<(SHARED_INTERMEDIATE_DIR)/ports/fonts/fonts.cpp',
116 ],
117 'action': ['python', '../tools/embed_resources.py',
118 '--align', '4',
119 '--name', '<(embedded_font_data_identifier)',
120 '--input', '<@(fonts_to_include)',
121 '--output', '<@(_outputs)',
122 ],
123 'message': 'Generating <@(_outputs)',
124 'process_outputs_as_sources': 1,
125 }],
126 'defines': [
127 'SK_EMBEDDED_FONTS=<(embedded_font_data_identifier)',
128 ],
129 }, 'skia_no_fontconfig', {
bungeman5cf19492015-06-15 15:17:21 -0700130 'sources/': [['include', '../src/ports/SkFontMgr_custom_directory_factory.cpp']],
bungeman786ece12015-07-15 10:58:47 -0700131 }, 'skia_os == "android"', {
132 'sources/': [['include', '../src/ports/SkFontMgr_android_factory.cpp']],
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +0000133 }, {
134 'link_settings': {
135 'libraries': [
136 '-lfontconfig',
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +0000137 ],
138 },
139 'sources': [
bungemana6785cc2014-08-25 12:00:49 -0700140 '../src/ports/SkFontMgr_fontconfig.cpp',
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +0000141 '../src/ports/SkFontHost_fontconfig.cpp',
142 '../src/ports/SkFontConfigInterface_direct.cpp',
benjaminwagner2211a7b2015-12-01 11:12:05 -0800143 '../src/ports/SkFontConfigInterface_direct_factory.cpp',
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +0000144 ],
bungeman0b1de262015-06-17 07:55:59 -0700145 'sources/': [['include', '../src/ports/SkFontMgr_fontconfig_factory.cpp']],
commit-bot@chromium.orgf84722e2014-02-24 20:22:34 +0000146 }]
borenet@google.com7158e6a2012-11-01 17:43:44 +0000147 ],
148 }],
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000149 [ 'skia_os == "mac"', {
150 'include_dirs': [
151 '../include/utils/mac',
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000152 ],
153 'sources': [
mike@reedtribe.orgb103ed42013-03-03 03:50:09 +0000154 '../src/ports/SkFontHost_mac.cpp',
scroggo@google.comd9ef3a22013-03-15 18:08:09 +0000155 '../src/utils/mac/SkStream_mac.cpp',
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000156 ],
157 }],
158 [ 'skia_os == "ios"', {
159 'include_dirs': [
160 '../include/utils/ios',
caryclark@google.com35f5ac92012-09-18 15:41:18 +0000161 '../include/utils/mac',
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000162 ],
163 'sources': [
mike@reedtribe.orgb103ed42013-03-03 03:50:09 +0000164 '../src/ports/SkFontHost_mac.cpp',
scroggo@google.comd9ef3a22013-03-15 18:08:09 +0000165 '../src/utils/mac/SkStream_mac.cpp',
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000166 ],
167 }],
168 [ 'skia_os == "win"', {
169 'include_dirs': [
170 'config/win',
bungeman@google.come8f05922012-08-16 16:13:40 +0000171 '../src/utils/win',
172 ],
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000173 'sources!': [ # these are used everywhere but windows
174 '../src/ports/SkDebug_stdio.cpp',
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000175 '../src/ports/SkOSFile_posix.cpp',
hendrikwb1ac52f2015-10-01 18:29:34 -0700176 '../src/ports/SkOSLibrary_posix.cpp',
bungeman@google.comf2e7dbb2013-07-16 14:59:24 +0000177 '../src/ports/SkTime_Unix.cpp',
178 '../src/ports/SkTLS_pthread.cpp',
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000179 ],
bungeman@google.combfc6cc42013-08-21 15:20:43 +0000180 'conditions': [
181 # when we build for win, we only want one of these default files
Mike Klein93587062014-07-16 13:06:04 -0400182 [ 'skia_gdi', {
bungeman5cf19492015-06-15 15:17:21 -0700183 'sources/': [['include', '../src/ports/SkFontMgr_win_gdi_factory.cpp']],
Mike Klein93587062014-07-16 13:06:04 -0400184 }, { # normally default to direct write
bungeman5cf19492015-06-15 15:17:21 -0700185 'sources/': [['include', '../src/ports/SkFontMgr_win_dw_factory.cpp']],
bungeman@google.combfc6cc42013-08-21 15:20:43 +0000186 }],
187 ],
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000188 }, { # else !win
189 'sources!': [
190 '../src/ports/SkDebug_win.cpp',
191 '../src/ports/SkFontHost_win.cpp',
bungeman51daa252014-06-05 13:38:45 -0700192 '../src/ports/SkFontMgr_win_dw.cpp',
bungeman@google.com6cab1a42013-05-29 13:43:31 +0000193 '../src/ports/SkOSFile_win.cpp',
hendrikwb1ac52f2015-10-01 18:29:34 -0700194 '../src/ports/SkOSLibrary_win.cpp',
bungeman@google.com04c32a82014-03-21 23:19:10 +0000195 '../src/ports/SkRemotableFontMgr_win_dw.cpp',
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000196 '../src/ports/SkTime_win.cpp',
bungeman@google.comf2e7dbb2013-07-16 14:59:24 +0000197 '../src/ports/SkTLS_win.cpp',
Ben Wagner98875e12014-06-05 16:55:58 -0400198 '../src/ports/SkScalerContext_win_dw.cpp',
bungeman51daa252014-06-05 13:38:45 -0700199 '../src/ports/SkScalerContext_win_dw.h',
200 '../src/ports/SkTypeface_win_dw.cpp',
201 '../src/ports/SkTypeface_win_dw.h',
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000202 ],
203 }],
204 [ 'skia_os == "android"', {
205 'sources!': [
206 '../src/ports/SkDebug_stdio.cpp',
207 ],
208 'sources': [
209 '../src/ports/SkDebug_android.cpp',
djsollen@google.com62b24b12011-12-15 16:16:22 +0000210 ],
rmistry@google.comd6176b02012-08-23 18:14:13 +0000211 }],
caryclark@google.comafcb55c2011-12-14 17:12:04 +0000212 ],
213 'direct_dependent_settings': {
214 'include_dirs': [
215 '../include/ports',
216 ],
217 },
218 },
219 ],
220}