blob: fea93a3abcbe90dd2fbe30e93653cc0fce62b22e [file] [log] [blame]
Dan Sinclaira03c3432016-03-16 15:35:20 -04001# Copyright 2013 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5
6# This gypi file contains the Skia library.
7# In component mode (shared_lib) it is folded into a single shared library with
8# the Chrome-specific enhancements but in all other cases it is a separate lib.
9
10# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11# variables and defines should go in skia_common.gypi so they can be seen
12# by files listed here and in skia_library_opts.gypi.
13# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14{
15 'dependencies': [
16 'skia_library_opts.gyp:skia_opts',
17 '../third_party/third_party.gyp:fx_zlib',
18 ],
19
20 'includes': [
21 '../third_party/skia/gyp/core.gypi',
22 '../third_party/skia/gyp/effects.gypi',
23 '../third_party/skia/gyp/pdf.gypi',
24 '../third_party/skia/gyp/utils.gypi',
25 ],
26
27 'sources': [
28 '../third_party/skia/src/lazy/SkDiscardableMemoryPool.cpp',
29
30 '../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
31 '../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
32
33 '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
34 '../third_party/skia/src/ports/SkFontConfigInterface_direct_factory.cpp',
35
36 '../third_party/skia/src/ports/SkDiscardableMemory_none.cpp',
37
38 '../third_party/skia/src/fonts/SkFontMgr_indirect.cpp',
39 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
40
41 '../third_party/skia/src/ports/SkFontMgr_empty_factory.cpp',
42 '../third_party/skia/src/fonts/SkFontMgr_indirect.cpp',
43 '../third_party/skia/src/fonts/SkRemotableFontMgr.cpp',
44 '../third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp',
45
46 '../third_party/skia/src/ports/SkImageGenerator_none.cpp',
47
48 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
49 '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
50 '../third_party/skia/src/ports/SkFontHost_mac.cpp',
51 '../third_party/skia/src/ports/SkFontHost_win.cpp',
52 "../third_party/skia/src/ports/SkFontMgr_android.cpp",
53 "../third_party/skia/src/ports/SkFontMgr_android_factory.cpp",
54 '../third_party/skia/src/ports/SkFontMgr_android_parser.cpp',
55 '../third_party/skia/src/ports/SkFontMgr_win_dw.cpp',
56 '../third_party/skia/src/ports/SkGlobalInitialization_default.cpp',
57 '../third_party/skia/src/ports/SkMemory_malloc.cpp',
58 '../third_party/skia/src/ports/SkOSFile_posix.cpp',
59 '../third_party/skia/src/ports/SkOSFile_stdio.cpp',
60 '../third_party/skia/src/ports/SkOSFile_win.cpp',
61 '../third_party/skia/src/ports/SkScalerContext_win_dw.cpp',
62 '../third_party/skia/src/ports/SkTime_Unix.cpp',
63 '../third_party/skia/src/ports/SkTLS_pthread.cpp',
64 '../third_party/skia/src/ports/SkTLS_win.cpp',
65 '../third_party/skia/src/ports/SkTypeface_win_dw.cpp',
66
67 '../third_party/skia/src/sfnt/SkOTTable_name.cpp',
68 '../third_party/skia/src/sfnt/SkOTUtils.cpp',
69 ],
70
71 # Exclude all unused files in skia utils.gypi file
72 'sources!': [
73 '../third_party/skia/src/utils/SkBoundaryPatch.cpp',
74 '../third_party/skia/src/utils/SkFrontBufferedStream.cpp',
75 '../third_party/skia/src/utils/SkCamera.cpp',
76 '../third_party/skia/src/utils/SkDumpCanvas.cpp',
77 '../third_party/skia/src/utils/SkInterpolator.cpp',
78 '../third_party/skia/src/utils/SkLayer.cpp',
79 '../third_party/skia/src/utils/SkMD5.cpp',
80 '../third_party/skia/src/utils/SkMeshUtils.cpp',
81 '../third_party/skia/src/utils/SkNinePatch.cpp',
82 '../third_party/skia/src/utils/SkOSFile.cpp',
83 '../third_party/skia/src/utils/SkParsePath.cpp',
84
85#windows
86 '../third_party/skia/src/utils/win/SkAutoCoInitialize.cpp',
87 '../third_party/skia/src/utils/win/SkIStream.cpp',
88 '../third_party/skia/src/utils/win/SkWGL_win.cpp',
89
90#testing
91 '../third_party/skia/src/fonts/SkGScalerContext.cpp',
92 ],
93
94 'include_dirs': [
95 '../third_party/skia/include/c',
96 '../third_party/skia/include/core',
97 '../third_party/skia/include/client/android',
98 '../third_party/skia/include/effects',
99 '../third_party/skia/include/images',
100 '../third_party/skia/include/lazy',
101 '../third_party/skia/include/pathops',
102 '../third_party/skia/include/pdf',
103 '../third_party/skia/include/pipe',
104 '../third_party/skia/include/ports',
105 '../third_party/skia/include/private',
106 '../third_party/skia/include/utils',
107 '../third_party/skia/src/core',
108 '../third_party/skia/src/opts',
109 '../third_party/skia/src/image',
110 '../third_party/skia/src/pdf',
111 '../third_party/skia/src/ports',
112 '../third_party/skia/src/sfnt',
113 '../third_party/skia/src/utils',
114 '../third_party/skia/src/lazy',
115 ],
116 'conditions': [
117 ['skia_support_gpu != 0', {
118 'includes': [
119 '../third_party/skia/gyp/gpu.gypi',
120 ],
121 'sources': [
122 '<@(skgpu_null_gl_sources)',
123 '<@(skgpu_sources)',
124 ],
125 'include_dirs': [
126 '../third_party/skia/include/gpu',
127 '../third_party/skia/src/gpu',
128 ],
129 }],
130 ['skia_support_pdf == 0', {
131 'sources/': [
132 ['exclude', '../third_party/skia/src/doc/SkDocument_PDF.cpp'],
133 ['exclude', '../third_party/skia/src/pdf/'],
134 ],
135 }],
136 ['skia_support_pdf == 1', {
137 'dependencies': [
138 '../third_party/sfntly/sfntly.gyp:sfntly',
139 ],
140 }],
141
142 [ 'OS == "win"', {
143 'sources!': [
144 # Keeping _win.cpp
145 "../third_party/skia/src/utils/SkThreadUtils_pthread.cpp",
146 ],
147 },{
148 'sources!': [
149 # Keeping _pthread.cpp
150 "../third_party/skia/src/utils/SkThreadUtils_win.cpp",
151 ],
152 }],
153
154 [ 'OS != "mac"', {
155 'sources/': [
156 ['exclude', '/mac/']
157 ],
158 }],
159 [ 'OS == "android" and target_arch == "arm"', {
160 'sources': [
161 '../third_party/skia/src/core/SkUtilsArm.cpp',
162 ],
163 }],
164 [ 'OS=="linux"', {
165 'dependencies': [
166 '../third_party/third_party.gyp:fx_freetype'
167 ],
168 'cflags': [
169 '-Wno-unused',
170 '-Wno-unused-function',
171 ],
172 # TODO(dsinclair): Right way to use third_party.gyp:fx_freetype?
173 'include_dirs': [
174 '../third_party/freetype/include',
175 ],
176 }],
177 [ 'OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', {
178 'sources!': [
179 '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
180 '../third_party/skia/src/ports/SkFontConfigInterface_direct_factory.cpp',
181 '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
182 '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
183 ],
184 }],
185 [ 'OS=="win" or OS=="mac" or OS=="ios"', {
186 'sources!': [
187 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
188 '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
189
190 ],
191 }],
192 [ 'OS == "android"', {
193 'dependencies': [
194 '../third_party/expat/expat.gyp:expat',
195 '../third_party/freetype-android/freetype.gyp:ft2',
196 ],
197 # This exports a hard dependency because it needs to run its
198 # symlink action in order to expose the skia header files.
199 'hard_dependency': 1,
200 'include_dirs': [
201 '../third_party/expat/files/lib',
202 ],
203 },{ # not 'OS == "android"'
204 'sources!': [
205 "../third_party/skia/src/ports/SkFontMgr_android_factory.cpp",
206 '../third_party/skia/src/ports/SkFontMgr_android_parser.cpp',
207 ],
208 }],
209 [ 'OS == "ios"', {
210 'include_dirs': [
211 '../third_party/skia/include/utils/ios',
212 '../third_party/skia/include/utils/mac',
213 ],
214 'link_settings': {
215 'libraries': [
216 '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
217 ],
218 },
219 'sources': [
220 # This file is used on both iOS and Mac, so it should be removed
221 # from the ios and mac conditions and moved into the main sources
222 # list.
223 '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
224 ],
225
226 # The main skia_opts target does not currently work on iOS because the
227 # target architecture on iOS is determined at compile time rather than
228 # gyp time (simulator builds are x86, device builds are arm). As a
229 # temporary measure, this is a separate opts target for iOS-only, using
230 # the _none.cpp files to avoid architecture-dependent implementations.
231 'dependencies': [
232 'skia_library_opts.gyp:skia_opts_none',
233 ],
234 'dependencies!': [
235 'skia_library_opts.gyp:skia_opts',
236 ],
237 }],
238 [ 'OS == "mac"', {
239 'direct_dependent_settings': {
240 'include_dirs': [
241 '../third_party/skia/include/utils/mac',
242 ],
243 },
244 'include_dirs': [
245 '../third_party/skia/include/utils/mac',
246 ],
247 'link_settings': {
248 'libraries': [
249 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
250 ],
251 },
252 'sources': [
253 '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
254 ],
255 }],
256 [ 'OS == "win"', {
257 'sources!': [
258 '../third_party/skia/src/ports/SkOSFile_posix.cpp',
259 '../third_party/skia/src/ports/SkTime_Unix.cpp',
260 '../third_party/skia/src/ports/SkTLS_pthread.cpp',
261 ],
262 'include_dirs': [
263 '../third_party/skia/include/utils/win',
264 '../third_party/skia/src/utils/win',
265 ],
266 },{ # not 'OS == "win"'
267 'sources!': [
268 '../third_party/skia/src/ports/SkFontMgr_win_dw.cpp',
269 '../third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp',
270 '../third_party/skia/src/ports/SkScalerContext_win_dw.cpp',
271 '../third_party/skia/src/ports/SkTypeface_win_dw.cpp',
272
273 '../third_party/skia/src/utils/win/SkDWrite.cpp',
274 '../third_party/skia/src/utils/win/SkDWriteFontFileStream.cpp',
275 '../third_party/skia/src/utils/win/SkDWriteGeometrySink.cpp',
276 '../third_party/skia/src/utils/win/SkHRESULT.cpp',
277 ],
278 }],
279 ],
280 'target_conditions': [
281 # Pull in specific Mac files for iOS (which have been filtered out
282 # by file name rules).
283 [ 'OS == "ios"', {
284 'sources/': [
285 ['include', 'SkFontHost_mac\\.cpp$',],
286 ['include', 'SkStream_mac\\.cpp$',],
287 ['include', 'SkCreateCGImageRef\\.cpp$',],
288 ],
289 'xcode_settings' : {
290 'WARNING_CFLAGS': [
291 # SkFontHost_mac.cpp uses API deprecated in iOS 7.
292 # crbug.com/408571
293 '-Wno-deprecated-declarations',
294 ],
295 },
296 }],
297 ],
298
299 'direct_dependent_settings': {
300 'include_dirs': [
301 '../third_party/skia/include/core',
302 '../third_party/skia/include/effects',
303 '../third_party/skia/include/pdf',
304 '../third_party/skia/include/gpu',
305 '../third_party/skia/include/lazy',
306 '../third_party/skia/include/pathops',
307 '../third_party/skia/include/pipe',
308 '../third_party/skia/include/ports',
309 '../third_party/skia/include/utils',
310 ],
311 },
312}