Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: skia/skia.gyp

Issue 18177021: Refactor Skia's GYP to separate Chrome additions from the core lib. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | skia/skia_chrome.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 { 5 {
6 'conditions': [
7 # In component mode (shared_lib), we build all of content as a single DLL.
8 # However, in the static mode, we need to build content as multiple targets
9 # in order to support the use case where a platform (e.g. Android) may
10 # already have a copy of skia as a system library.
11 ['component=="static_library"', {
12 'targets': [
13 {
14 'target_name': 'skia',
15 'type': 'none',
16 'dependencies': [
17 'skia_library',
18 'skia_chrome',
19 ],
20 'export_dependent_settings': [
21 'skia_library',
22 'skia_chrome',
23 ],
24 },
25 {
26 'target_name': 'skia_library',
27 'type': 'static_library',
28 'includes': [
29 'skia_library.gypi',
30 'skia_common.gypi',
31 ],
32 },
33 {
34 'target_name': 'skia_chrome',
35 'type': 'static_library',
36 'includes': [
37 'skia_chrome.gypi',
38 'skia_common.gypi',
39 ],
40 },
41 ],
42 },
43 { # component != static_library
44 'targets': [
45 {
46 'target_name': 'skia',
47 'type': 'shared_library',
48 'includes': [
49 'skia_library.gypi',
50 'skia_chrome.gypi',
51 'skia_common.gypi',
52 ],
53 'defines': [
54 'SKIA_DLL',
55 'GR_DLL=1',
56 'GR_IMPLEMENTATION=1',
57 'SKIA_IMPLEMENTATION=1',
58 ],
59 'direct_dependent_settings': {
60 'defines': [
61 'SKIA_DLL',
62 'GR_DLL=1',
63 ],
64 },
65 },
66 {
67 'target_name': 'skia_library',
68 'type': 'none',
69 },
70 {
71 'target_name': 'skia_chrome',
72 'type': 'none',
73 },
74 ],
75 }],
76 ],
77
78 # targets that are not dependent upon the component type
6 'targets': [ 79 'targets': [
7 { 80 {
8 'target_name': 'skia', 81 'target_name': 'skia_chrome_opts',
9 'type': '<(component)', 82 'type': 'static_library',
10 'variables': {
11 'conditions': [
12 ['OS== "ios"', {
13 'skia_support_gpu': 0,
14 }, {
15 'skia_support_gpu': 1,
16 }],
17 ],
18
19 'optimize': 'max',
20
21 # These two set the paths so we can include skia/gyp/core.gypi
22 'skia_src_path': '../third_party/skia/src',
23 'skia_include_path': '../third_party/skia/include',
24 },
25
26 'includes': [
27 '../third_party/skia/gyp/core.gypi',
28 '../third_party/skia/gyp/effects.gypi',
29 ],
30
31 'sources': [
32 # this should likely be moved into src/utils in skia
33 '../third_party/skia/src/core/SkFlate.cpp',
34 # We don't want to add this to Skia's core.gypi since it is
35 # Android only. Include it here and remove it for everyone
36 # but Android later.
37 '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
38
39 '../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
40 #'../third_party/skia/src/images/bmpdecoderhelper.cpp',
41 #'../third_party/skia/src/images/bmpdecoderhelper.h',
42 #'../third_party/skia/src/images/SkFDStream.cpp',
43 #'../third_party/skia/src/images/SkImageDecoder.cpp',
44 #'../third_party/skia/src/images/SkImageDecoder_FactoryDefault.cpp',
45 #'../third_party/skia/src/images/SkImageDecoder_FactoryRegistrar.cpp',
46 #'../third_party/skia/src/images/SkImageDecoder_fpdfemb.cpp',
47 #'../third_party/skia/src/images/SkImageDecoder_libbmp.cpp',
48 #'../third_party/skia/src/images/SkImageDecoder_libgif.cpp',
49 #'../third_party/skia/src/images/SkImageDecoder_libico.cpp',
50 #'../third_party/skia/src/images/SkImageDecoder_libjpeg.cpp',
51 #'../third_party/skia/src/images/SkImageDecoder_libpng.cpp',
52 #'../third_party/skia/src/images/SkImageDecoder_libpvjpeg.cpp',
53 #'../third_party/skia/src/images/SkImageDecoder_wbmp.cpp',
54 #'../third_party/skia/src/images/SkImageEncoder.cpp',
55 #'../third_party/skia/src/images/SkImageEncoder_Factory.cpp',
56 #'../third_party/skia/src/images/SkImageRef.cpp',
57 #'../third_party/skia/src/images/SkImageRefPool.cpp',
58 #'../third_party/skia/src/images/SkImageRefPool.h',
59 #'../third_party/skia/src/images/SkImageRef_GlobalPool.cpp',
60 #'../third_party/skia/src/images/SkMovie.cpp',
61 #'../third_party/skia/src/images/SkMovie_gif.cpp',
62 '../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
63 '../third_party/skia/src/images/SkScaledBitmapSampler.h',
64
65 '../third_party/skia/src/opts/opts_check_SSE2.cpp',
66
67 '../third_party/skia/src/pdf/SkPDFCatalog.cpp',
68 '../third_party/skia/src/pdf/SkPDFCatalog.h',
69 '../third_party/skia/src/pdf/SkPDFDevice.cpp',
70 '../third_party/skia/src/pdf/SkPDFDocument.cpp',
71 '../third_party/skia/src/pdf/SkPDFFont.cpp',
72 '../third_party/skia/src/pdf/SkPDFFont.h',
73 '../third_party/skia/src/pdf/SkPDFFormXObject.cpp',
74 '../third_party/skia/src/pdf/SkPDFFormXObject.h',
75 '../third_party/skia/src/pdf/SkPDFGraphicState.cpp',
76 '../third_party/skia/src/pdf/SkPDFGraphicState.h',
77 '../third_party/skia/src/pdf/SkPDFImage.cpp',
78 '../third_party/skia/src/pdf/SkPDFImage.h',
79 '../third_party/skia/src/pdf/SkPDFImageStream.cpp',
80 '../third_party/skia/src/pdf/SkPDFImageStream.h',
81 '../third_party/skia/src/pdf/SkPDFPage.cpp',
82 '../third_party/skia/src/pdf/SkPDFPage.h',
83 '../third_party/skia/src/pdf/SkPDFShader.cpp',
84 '../third_party/skia/src/pdf/SkPDFShader.h',
85 '../third_party/skia/src/pdf/SkPDFStream.cpp',
86 '../third_party/skia/src/pdf/SkPDFStream.h',
87 '../third_party/skia/src/pdf/SkPDFTypes.cpp',
88 '../third_party/skia/src/pdf/SkPDFTypes.h',
89 '../third_party/skia/src/pdf/SkPDFUtils.cpp',
90 '../third_party/skia/src/pdf/SkPDFUtils.h',
91
92 #'../third_party/skia/src/ports/SkPurgeableMemoryBlock_android.cpp',
93 #'../third_party/skia/src/ports/SkPurgeableMemoryBlock_mac.cpp',
94 '../third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp',
95
96 '../third_party/skia/src/ports/SkFontConfigInterface_android.cpp',
97 #'../third_party/skia/src/ports/SkFontHost_FONTPATH.cpp',
98 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
99 '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
100 '../third_party/skia/src/ports/SkFontHost_FreeType_common.h',
101 '../third_party/skia/src/ports/SkFontConfigParser_android.cpp',
102 #'../third_party/skia/src/ports/SkFontHost_ascender.cpp',
103 #'../third_party/skia/src/ports/SkFontHost_linux.cpp',
104 '../third_party/skia/src/ports/SkFontHost_mac.cpp',
105 #'../third_party/skia/src/ports/SkFontHost_none.cpp',
106 '../third_party/skia/src/ports/SkFontHost_win.cpp',
107 '../third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp',
108 #'../third_party/skia/src/ports/SkImageDecoder_CG.cpp',
109 #'../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
110 #'../third_party/skia/src/ports/SkImageRef_ashmem.cpp',
111 #'../third_party/skia/src/ports/SkImageRef_ashmem.h',
112 #'../third_party/skia/src/ports/SkOSEvent_android.cpp',
113 #'../third_party/skia/src/ports/SkOSEvent_dummy.cpp',
114 '../third_party/skia/src/ports/SkOSFile_posix.cpp',
115 '../third_party/skia/src/ports/SkOSFile_stdio.cpp',
116 '../third_party/skia/src/ports/SkOSFile_win.cpp',
117 #'../third_party/skia/src/ports/SkThread_none.cpp',
118 '../third_party/skia/src/ports/SkThread_pthread.cpp',
119 '../third_party/skia/src/ports/SkTLS_pthread.cpp',
120 '../third_party/skia/src/ports/SkThread_win.cpp',
121 '../third_party/skia/src/ports/SkTLS_win.cpp',
122 '../third_party/skia/src/ports/SkTime_Unix.cpp',
123 #'../third_party/skia/src/ports/SkXMLParser_empty.cpp',
124 #'../third_party/skia/src/ports/SkXMLParser_expat.cpp',
125 #'../third_party/skia/src/ports/SkXMLParser_tinyxml.cpp',
126 #'../third_party/skia/src/ports/SkXMLPullParser_expat.cpp',
127
128 '../third_party/skia/src/sfnt/SkOTUtils.cpp',
129 '../third_party/skia/src/sfnt/SkOTUtils.h',
130
131 '../third_party/skia/include/utils/mac/SkCGUtils.h',
132 '../third_party/skia/include/utils/SkDeferredCanvas.h',
133 '../third_party/skia/include/utils/SkMatrix44.h',
134 '../third_party/skia/src/utils/debugger/SkDebugCanvas.cpp',
135 '../third_party/skia/src/utils/debugger/SkDebugCanvas.h',
136 '../third_party/skia/src/utils/debugger/SkDrawCommand.cpp',
137 '../third_party/skia/src/utils/debugger/SkDrawCommand.h',
138 '../third_party/skia/src/utils/debugger/SkObjectParser.cpp',
139 '../third_party/skia/src/utils/debugger/SkObjectParser.h',
140 '../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp',
141 '../third_party/skia/src/utils/SkBase64.cpp',
142 '../third_party/skia/src/utils/SkBase64.h',
143 '../third_party/skia/src/utils/SkBitSet.cpp',
144 '../third_party/skia/src/utils/SkBitSet.h',
145 '../third_party/skia/src/utils/SkDeferredCanvas.cpp',
146 '../third_party/skia/src/utils/SkMatrix44.cpp',
147 '../third_party/skia/src/utils/SkNullCanvas.cpp',
148 '../third_party/skia/include/utils/SkNWayCanvas.h',
149 '../third_party/skia/src/utils/SkNWayCanvas.cpp',
150 '../third_party/skia/src/utils/SkPictureUtils.cpp',
151 '../third_party/skia/src/utils/SkRTConf.cpp',
152 '../third_party/skia/include/utils/SkRTConf.h',
153 '../third_party/skia/include/pdf/SkPDFDevice.h',
154 '../third_party/skia/include/pdf/SkPDFDocument.h',
155
156 '../third_party/skia/include/ports/SkTypeface_win.h',
157
158 #'../third_party/skia/include/images/SkImageDecoder.h',
159 #'../third_party/skia/include/images/SkImageEncoder.h',
160 '../third_party/skia/include/images/SkImageRef.h',
161 '../third_party/skia/include/images/SkImageRef_GlobalPool.h',
162 '../third_party/skia/include/images/SkMovie.h',
163 '../third_party/skia/include/images/SkPageFlipper.h',
164
165 '../third_party/skia/include/utils/SkNullCanvas.h',
166 '../third_party/skia/include/utils/SkPictureUtils.h',
167 'ext/analysis_canvas.cc',
168 'ext/analysis_canvas.h',
169 'ext/bitmap_platform_device.h',
170 'ext/bitmap_platform_device_android.cc',
171 'ext/bitmap_platform_device_android.h',
172 'ext/bitmap_platform_device_data.h',
173 'ext/bitmap_platform_device_linux.cc',
174 'ext/bitmap_platform_device_linux.h',
175 'ext/bitmap_platform_device_mac.cc',
176 'ext/bitmap_platform_device_mac.h',
177 'ext/bitmap_platform_device_win.cc',
178 'ext/bitmap_platform_device_win.h',
179 'ext/convolver.cc',
180 'ext/convolver.h',
181 'ext/google_logging.cc',
182 'ext/image_operations.cc',
183 'ext/image_operations.h',
184 'ext/lazy_pixel_ref.cc',
185 'ext/lazy_pixel_ref.h',
186 'ext/lazy_pixel_ref_utils.cc',
187 'ext/lazy_pixel_ref_utils.h',
188 'ext/SkThread_chrome.cc',
189 'ext/paint_simplifier.cc',
190 'ext/paint_simplifier.h',
191 'ext/platform_canvas.cc',
192 'ext/platform_canvas.h',
193 'ext/platform_device.cc',
194 'ext/platform_device.h',
195 'ext/platform_device_linux.cc',
196 'ext/platform_device_mac.cc',
197 'ext/platform_device_win.cc',
198 'ext/recursive_gaussian_convolution.cc',
199 'ext/recursive_gaussian_convolution.h',
200 'ext/refptr.h',
201 'ext/SkMemory_new_handler.cpp',
202 'ext/skia_trace_shim.h',
203 'ext/skia_utils_base.cc',
204 'ext/skia_utils_base.h',
205 'ext/skia_utils_ios.mm',
206 'ext/skia_utils_ios.h',
207 'ext/skia_utils_mac.mm',
208 'ext/skia_utils_mac.h',
209 'ext/skia_utils_win.cc',
210 'ext/skia_utils_win.h',
211 'ext/vector_canvas.cc',
212 'ext/vector_canvas.h',
213 'ext/vector_platform_device_emf_win.cc',
214 'ext/vector_platform_device_emf_win.h',
215 'ext/vector_platform_device_skia.cc',
216 'ext/vector_platform_device_skia.h',
217 ],
218 'include_dirs': [ 83 'include_dirs': [
219 '..', 84 '..',
220 'config', 85 'config',
221 '../third_party/skia/include/config', 86 '../third_party/skia/include/config',
222 '../third_party/skia/include/core', 87 '../third_party/skia/include/core',
223 '../third_party/skia/include/effects',
224 '../third_party/skia/include/images',
225 '../third_party/skia/include/lazy',
226 '../third_party/skia/include/pathops',
227 '../third_party/skia/include/pdf',
228 '../third_party/skia/include/pipe',
229 '../third_party/skia/include/ports',
230 '../third_party/skia/include/utils',
231 '../third_party/skia/src/core',
232 '../third_party/skia/src/image',
233 '../third_party/skia/src/sfnt',
234 '../third_party/skia/src/utils',
235 '../third_party/skia/src/lazy',
236 ],
237 'msvs_disabled_warnings': [4244, 4267, 4341, 4345, 4390, 4554, 4748, 4800] ,
238 'defines': [
239 #'SK_GAMMA_SRGB',
240 #'SK_GAMMA_APPLY_TO_A8',
241 'SK_BUILD_NO_IMAGE_ENCODE',
242 'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
243 'GR_STATIC_RECT_VB=1',
244 'GR_AGGRESSIVE_SHADER_OPTS=1',
245 'SK_DEFERRED_CANVAS_USES_GPIPE=1',
246 'SK_ENABLE_INST_COUNT=0',
247
248 # this flag can be removed entirely once this has baked for a while
249 'SK_ALLOW_OVER_32K_BITMAPS',
250
251 # skia uses static initializers to initialize the serialization logic
252 # of its "pictures" library. This is currently not used in chrome; if
253 # it ever gets used the processes that use it need to call
254 # SkGraphics::Init().
255 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
256
257 # Disable this check because it is too strict for some Chromium-specific
258 # subclasses of SkPixelRef. See bug: crbug.com/171776.
259 'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK',
260
261 'IGNORE_ROT_AA_RECT_OPT',
262 ],
263 'sources!': [
264 '../third_party/skia/include/core/SkTypes.h',
265 ],
266 'conditions': [
267 ['skia_support_gpu != 0', {
268 'includes': [
269 '../third_party/skia/gyp/gpu.gypi',
270 ],
271 'sources': [
272 '<@(skgpu_sources)',
273 ],
274 'include_dirs': [
275 '../third_party/skia/include/gpu',
276 '../third_party/skia/include/gpu/gl',
277 '../third_party/skia/src/gpu',
278 ],
279 }, { # skia_support_gpu == 0
280 'defines': [
281 'SK_SUPPORT_GPU=0',
282 ],
283 }],
284 #Settings for text blitting, chosen to approximate the system browser.
285 [ 'OS == "linux"', {
286 'defines': [
287 'SK_GAMMA_EXPONENT=1.2',
288 'SK_GAMMA_CONTRAST=0.2',
289 ],
290 }],
291 ['OS == "android"', {
292 'defines': [
293 'SK_GAMMA_APPLY_TO_A8',
294 'SK_GAMMA_EXPONENT=1.4',
295 'SK_GAMMA_CONTRAST=0.0',
296 ],
297 }],
298 ['OS == "win"', {
299 'defines': [
300 'SK_GAMMA_SRGB',
301 'SK_GAMMA_CONTRAST=0.5',
302 ],
303 }],
304 ['OS == "mac"', {
305 'defines': [
306 'SK_GAMMA_SRGB',
307 'SK_GAMMA_CONTRAST=0.0',
308 ],
309 }],
310
311 # For POSIX platforms, prefer the Mutex implementation provided by Skia
312 # since it does not generate static initializers.
313 [ 'OS == "android" or OS == "linux" or OS == "mac" or OS == "ios"', {
314 'defines+': [
315 'SK_USE_POSIX_THREADS',
316 ],
317 'direct_dependent_settings': {
318 'defines': [
319 'SK_USE_POSIX_THREADS',
320 ],
321 },
322 'sources!': [
323 'ext/SkThread_chrome.cc',
324 ],
325 }],
326 [ 'OS != "android"', {
327 'sources/': [
328 ['exclude', '_android\\.(cc|cpp)$'],
329 ],
330 'sources!': [
331 '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
332 ],
333 'defines': [
334 'SK_DEFAULT_FONT_CACHE_LIMIT=(20*1024*1024)',
335 ],
336 }],
337 [ 'OS != "ios"', {
338 'sources/': [
339 ['exclude', '_ios\\.(cc|cpp|mm?)$'],
340 ],
341 'dependencies': [
342 '<(DEPTH)/third_party/WebKit/Source/WebKit/chromium/skia_webkit.gyp: skia_webkit',
343 ],
344 }],
345 [ 'OS != "mac"', {
346 'sources/': [
347 ['exclude', '_mac\\.(cc|cpp|mm?)$'],
348 ['exclude', '/mac/']
349 ],
350 }],
351 [ 'OS != "win"', {
352 'sources/': [ ['exclude', '_win\\.(cc|cpp)$'] ],
353 }],
354 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
355 'defines': [
356 '__ARM_HAVE_NEON',
357 ],
358 }],
359 [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1' , {
360 'defines': [
361 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
362 ],
363 }],
364 [ 'OS == "android" and target_arch == "arm"', {
365 'sources': [
366 '../third_party/skia/src/core/SkUtilsArm.cpp',
367 ],
368 'includes': [
369 '../build/android/cpufeatures.gypi',
370 ],
371 }],
372 [ 'target_arch == "arm" or target_arch == "mipsel"', {
373 'sources!': [
374 '../third_party/skia/src/opts/opts_check_SSE2.cpp'
375 ],
376 }],
377 [ 'use_glib == 1', {
378 'dependencies': [
379 '../build/linux/system.gyp:fontconfig',
380 '../build/linux/system.gyp:freetype2',
381 '../build/linux/system.gyp:pangocairo',
382 '../third_party/icu/icu.gyp:icuuc',
383 ],
384 'cflags': [
385 '-Wno-unused',
386 '-Wno-unused-function',
387 ],
388 'sources': [
389 '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
390 '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
391 '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
392 ],
393 'defines': [
394 # 'SK_USE_COLOR_LUMINANCE',
395 ],
396 }],
397 [ 'use_glib == 0 and OS != "android"', {
398 'sources/': [ ['exclude', '_linux\\.(cc|cpp)$'] ],
399 'sources!': [
400 '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
401 '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
402 ],
403 }],
404 [ 'toolkit_uses_gtk == 1', {
405 'dependencies': [
406 '../build/linux/system.gyp:gdk',
407 ],
408 }, { # toolkit_uses_gtk == 0
409 'sources/': [ ['exclude', '_gtk\\.(cc|cpp)$'] ],
410 }],
411 [ 'OS == "android"', {
412 'sources': [
413 '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
414 ],
415 'sources/': [
416 ['exclude', '_linux\\.(cc|cpp)$'],
417 ],
418 'conditions': [
419 [ '_toolset == "target"', {
420 'defines': [
421 'HAVE_PTHREADS',
422 'OS_ANDROID',
423 'SK_BUILD_FOR_ANDROID',
424 # Android devices are typically more memory constrained, so
425 # use a smaller glyph cache.
426 'SK_DEFAULT_FONT_CACHE_LIMIT=(8*1024*1024)',
427 'USE_CHROMIUM_SKIA',
428 ],
429 'dependencies': [
430 '../third_party/expat/expat.gyp:expat',
431 '../third_party/freetype/freetype.gyp:ft2',
432 'skia_opts'
433 ],
434 'dependencies!': [
435 # Android doesn't use Skia's PDF generation, which is what uses
436 # sfntly.
437 '../third_party/sfntly/sfntly.gyp:sfntly',
438 ],
439 # This exports a hard dependency because it needs to run its
440 # symlink action in order to expose the skia header files.
441 'hard_dependency': 1,
442 'include_dirs': [
443 '../third_party/expat/files/lib',
444 ],
445 'sources/': [
446 ['include', 'ext/platform_device_linux\\.cc$'],
447 ['exclude', '../third_party/skia/src/pdf/'],
448 ],
449 'sources!': [
450 'ext/vector_platform_device_skia.cc',
451 ],
452 }],
453 [ '_toolset == "target" and android_webview_build == 0', {
454 'defines': [
455 'HAVE_ENDIAN_H',
456 ],
457 }],
458 [ '_toolset=="host" and host_os=="linux"', {
459 'sources': [
460 'ext/platform_device_linux.cc',
461 ],
462 }],
463 ],
464 }],
465 [ 'OS == "ios"', {
466 'defines': [
467 'SK_BUILD_FOR_IOS',
468 'SK_USE_MAC_CORE_TEXT',
469 ],
470 'include_dirs': [
471 '../third_party/skia/include/utils/ios',
472 '../third_party/skia/include/utils/mac',
473 ],
474 'link_settings': {
475 'libraries': [
476 '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
477 ],
478 },
479 'dependencies': [
480 'skia_opts_ios',
481 ],
482 'dependencies!': [
483 'skia_opts',
484 '../third_party/sfntly/sfntly.gyp:sfntly',
485 ],
486 'sources': [
487 # This file is used on both iOS and Mac, so it should be removed
488 # from the ios and mac conditions and moved into the main sources
489 # list.
490 '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
491 ],
492 'sources/': [
493 ['exclude', '/pdf/'],
494 ['exclude', '^ext/vector_platform_device_skia\\.'],
495 ['exclude', 'opts_check_SSE2\\.cpp$'],
496 ],
497 }],
498 [ 'OS == "mac"', {
499 'defines': [
500 'SK_BUILD_FOR_MAC',
501 'SK_USE_MAC_CORE_TEXT',
502 # 'SK_USE_COLOR_LUMINANCE',
503 ],
504 'include_dirs': [
505 '../third_party/skia/include/utils/mac',
506 ],
507 'link_settings': {
508 'libraries': [
509 '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
510 ],
511 },
512 'sources': [
513 '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
514 ],
515 }],
516 [ 'OS == "win"', {
517 'sources!': [
518 '../third_party/skia/src/ports/SkOSFile_posix.cpp',
519 '../third_party/skia/src/ports/SkThread_pthread.cpp',
520 '../third_party/skia/src/ports/SkTLS_pthread.cpp',
521 '../third_party/skia/src/ports/SkTime_Unix.cpp',
522 'ext/SkThread_chrome.cc',
523 ],
524 'include_dirs': [
525 'config/win',
526 ],
527 'direct_dependent_settings': {
528 'include_dirs': [
529 'config/win',
530 ],
531 },
532 }],
533 ['component=="shared_library"', {
534 'defines': [
535 'GR_DLL=1',
536 'GR_IMPLEMENTATION=1',
537 'SKIA_DLL',
538 'SKIA_IMPLEMENTATION=1',
539 ],
540 'dependencies': [
541 '../base/base.gyp:base',
542 ],
543 'direct_dependent_settings': {
544 'defines': [
545 'GR_DLL',
546 'SKIA_DLL',
547 ],
548 },
549 }],
550 # TODO(scottmg): http://crbug.com/177306
551 ['clang==1', {
552 'xcode_settings': {
553 'WARNING_CFLAGS!': [
554 # Don't warn about string->bool used in asserts.
555 '-Wstring-conversion',
556 ],
557 },
558 'cflags!': [
559 '-Wstring-conversion',
560 ],
561 }],
562 ],
563 'dependencies': [
564 'skia_opts',
565 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic _annotations',
566 '../third_party/sfntly/sfntly.gyp:sfntly',
567 '../third_party/zlib/zlib.gyp:zlib',
568 ],
569 'direct_dependent_settings': {
570 'include_dirs': [
571 'config',
572
573 #temporary until we can hide SkFontHost
574 '../third_party/skia/src/core',
575
576 '../third_party/skia/include/config',
577 '../third_party/skia/include/core',
578 '../third_party/skia/include/effects',
579 '../third_party/skia/include/pdf',
580 '../third_party/skia/include/gpu',
581 '../third_party/skia/include/gpu/gl',
582 '../third_party/skia/include/lazy',
583 '../third_party/skia/include/pathops',
584 '../third_party/skia/include/pipe',
585 '../third_party/skia/include/ports',
586 '../third_party/skia/include/utils',
587 'ext',
588 ],
589 'defines': [
590 'SK_BUILD_NO_IMAGE_ENCODE',
591 'SK_DEFERRED_CANVAS_USES_GPIPE=1',
592 'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
593 'GR_AGGRESSIVE_SHADER_OPTS=1',
594 'SK_ENABLE_INST_COUNT=0',
595 ],
596 'conditions': [
597 ['OS=="android"', {
598 'dependencies!': [
599 'skia_opts',
600 '../third_party/zlib/zlib.gyp:zlib',
601 ],
602 'defines': [
603 # Don't use non-NDK available stuff.
604 'SK_BUILD_FOR_ANDROID',
605 ],
606 'conditions': [
607 [ '_toolset == "target" and android_webview_build == 0', {
608 'defines': [
609 'HAVE_ENDIAN_H',
610 ],
611 }],
612 ],
613 }],
614 ['OS=="mac"', {
615 'include_dirs': [
616 '../third_party/skia/include/utils/mac',
617 ],
618 }],
619 ],
620 },
621 'target_conditions': [
622 # Pull in specific Mac files for iOS (which have been filtered out
623 # by file name rules).
624 [ 'OS == "ios"', {
625 'sources/': [
626 ['include', 'SkFontHost_mac\\.cpp$',],
627 ['include', 'SkStream_mac\\.cpp$',],
628 ['include', 'SkCreateCGImageRef\\.cpp$',],
629 ],
630 }],
631 ],
632 },
633
634 # Due to an unfortunate intersection of lameness between gcc and gyp,
635 # we have to build the *_SSE2.cpp files in a separate target. The
636 # gcc lameness is that, in order to compile SSE2 intrinsics code, it
637 # must be passed the -msse2 flag. However, with this flag, it may
638 # emit SSE2 instructions even for scalar code, such as the CPUID
639 # test used to test for the presence of SSE2. So that, and all other
640 # code must be compiled *without* -msse2. The gyp lameness is that it
641 # does not allow file-specific CFLAGS, so we must create this extra
642 # target for those files to be compiled with -msse2.
643 #
644 # This is actually only a problem on 32-bit Linux (all Intel Macs have
645 # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit
646 # SSE2 from instrinsics, which generating plain ol' 386 for everything
647 # else). However, to keep the .gyp file simple and avoid platform-specific
648 # build breakage, we do this on all platforms.
649
650 # For about the same reason, we need to compile the ARM opts files
651 # separately as well.
652 {
653 'target_name': 'skia_opts',
654 'type': 'static_library',
655 'variables': {
656 'optimize': 'max',
657 },
658 'include_dirs': [
659 '..',
660 'config',
661 '../third_party/skia/include/config',
662 '../third_party/skia/include/core',
663 '../third_party/skia/include/effects',
664 '../third_party/skia/include/images',
665 '../third_party/skia/include/lazy',
666 '../third_party/skia/include/pathops',
667 '../third_party/skia/include/utils',
668 '../third_party/skia/src/core',
669 ], 88 ],
670 'conditions': [ 89 'conditions': [
671 [ 'os_posix == 1 and OS != "mac" and OS != "android" and \ 90 [ 'os_posix == 1 and OS != "mac" and OS != "android" and \
672 target_arch != "arm" and target_arch != "mipsel"', { 91 target_arch != "arm" and target_arch != "mipsel"', {
673 'cflags': [ 92 'cflags': [
674 '-msse2', 93 '-msse2',
675 ], 94 ],
676 }], 95 }],
677 [ 'OS == "android"', {
678 'defines': [
679 'SK_BUILD_FOR_ANDROID',
680 ],
681 }],
682 [ 'target_arch != "arm" and target_arch != "mipsel"', { 96 [ 'target_arch != "arm" and target_arch != "mipsel"', {
683 'sources': [ 97 'sources': [
684 '../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp',
685 '../third_party/skia/src/opts/SkBlitRect_opts_SSE2.cpp',
686 '../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp',
687 '../third_party/skia/src/opts/SkUtils_opts_SSE2.cpp',
688 '../third_party/skia/src/opts/SkBitmapFilter_opts_SSE2.cpp',
689 'ext/convolver_SSE2.cc', 98 'ext/convolver_SSE2.cc',
690 ], 99 ],
691 'conditions': [
692 # x86 Android doesn't support SSSE3 instructions.
693 [ 'OS != "android"', {
694 'dependencies': [
695 'skia_opts_ssse3',
696 ],
697 }],
698 ],
699 }],
700 [ 'target_arch == "arm"', {
701 'conditions': [
702 [ 'arm_version >= 7 and arm_neon == 1', {
703 'defines': [
704 '__ARM_HAVE_NEON',
705 ],
706 }],
707 [ 'arm_version >= 7 and arm_neon_optional == 1', {
708 'defines': [
709 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
710 ],
711 }],
712 [ 'arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
713 'cflags': [
714 # The neon assembly contains conditional instructions which
715 # aren't enclosed in an IT block. The assembler complains
716 # without this option.
717 # See #86592.
718 '-Wa,-mimplicit-it=always',
719 ],
720 'dependencies': [
721 'skia_opts_neon',
722 ]
723 }],
724 ],
725 # The assembly uses the frame pointer register (r7 in Thumb/r11 in
726 # ARM), the compiler doesn't like that. Explicitly remove the
727 # -fno-omit-frame-pointer flag for Android, as that gets added to all
728 # targets via common.gypi.
729 'cflags!': [
730 '-fno-omit-frame-pointer',
731 '-marm',
732 '-mapcs-frame',
733 ],
734 'cflags': [
735 '-fomit-frame-pointer',
736 ],
737 'sources': [
738 '../third_party/skia/src/opts/SkBitmapProcState_opts_arm.cpp',
739 ],
740 }],
741 [ 'target_arch == "arm" and (arm_version < 7 or (arm_neon == 0 and arm_n eon_optional == 1))', {
742 'sources': [
743 '../third_party/skia/src/opts/memset.arm.S',
744 ],
745 }],
746 [ 'target_arch == "arm" and arm_version < 6', {
747 'sources': [
748 '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
749 '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
750 ],
751 }],
752 [ 'target_arch == "arm" and arm_version >= 6', {
753 'sources': [
754 '../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp',
755 '../third_party/skia/src/opts/SkBlitRow_opts_arm.h',
756 '../third_party/skia/src/opts/opts_check_arm.cpp',
757 ],
758 }], 100 }],
759 [ 'target_arch == "mipsel"',{ 101 [ 'target_arch == "mipsel"',{
760 'cflags': [ 102 'cflags': [
761 '-fomit-frame-pointer', 103 '-fomit-frame-pointer',
762 ], 104 ],
763 'sources': [ 105 'sources': [
764 '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
765 '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
766 '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
767 'ext/convolver_mips_dspr2.cc', 106 'ext/convolver_mips_dspr2.cc',
768 ], 107 ],
769 }], 108 }],
770 ], 109 ],
771 }, 110 },
772 # For the same lame reasons as what is done for skia_opts, we have to
773 # create another target specifically for SSSE3 code as we would not want
774 # to compile the SSE2 code with -mssse3 which would potentially allow
775 # gcc to generate SSSE3 code.
776 {
777 'target_name': 'skia_opts_ssse3',
778 'type': 'static_library',
779 'variables': {
780 'optimize': 'max',
781 },
782 'include_dirs': [
783 '..',
784 'config',
785 '../third_party/skia/include/config',
786 '../third_party/skia/include/core',
787 '../third_party/skia/include/pathops',
788 '../third_party/skia/src/core',
789 ],
790 'conditions': [
791 [ 'OS in ["linux", "freebsd", "openbsd", "solaris"]', {
792 'cflags': [
793 '-mssse3',
794 ],
795 }],
796 [ 'OS == "mac"', {
797 'xcode_settings': {
798 'GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS': 'YES',
799 },
800 }],
801 [ 'OS == "win"', {
802 'include_dirs': [
803 'config/win',
804 ],
805 'direct_dependent_settings': {
806 'include_dirs': [
807 'config/win',
808 ],
809 },
810 }],
811 [ 'target_arch != "arm" and target_arch != "mipsel"', {
812 'sources': [
813 '../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp',
814 ],
815 }],
816 ],
817 },
818 # NEON code must be compiled with -mfpu=neon which also affects scalar
819 # code. To support dynamic NEON code paths, we need to build all
820 # NEON-specific sources in a separate static library. The situation
821 # is very similar to the SSSE3 one.
822 {
823 'target_name': 'skia_opts_neon',
824 'type': 'static_library',
825 'include_dirs': [
826 '..',
827 'config',
828 '../third_party/skia/include/config',
829 '../third_party/skia/include/core',
830 '../third_party/skia/src/core',
831 '../third_party/skia/src/opts',
832 ],
833 'cflags!': [
834 '-fno-omit-frame-pointer',
835 '-mfpu=vfp', # remove them all, just in case.
836 '-mfpu=vfpv3',
837 '-mfpu=vfpv3-d16',
838 ],
839 'cflags': [
840 '-mfpu=neon',
841 '-fomit-frame-pointer',
842 ],
843 'ldflags': [
844 '-march=armv7-a',
845 '-Wl,--fix-cortex-a8',
846 ],
847 'conditions': [
848 ['arm_neon == 1', {
849 'defines': [
850 '__ARM_HAVE_NEON',
851 ],
852 }],
853 ['arm_neon_optional == 1', {
854 'defines': [
855 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
856 ],
857 }],
858 ['target_arch == "arm" and (arm_neon == 1 or arm_neon_optional == 1)', {
859 'sources': [
860 '../third_party/skia/src/opts/memset16_neon.S',
861 '../third_party/skia/src/opts/memset32_neon.S',
862 '../third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp',
863 '../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp ',
864 '../third_party/skia/src/opts/SkBitmapProcState_matrix_clamp_neon.h' ,
865 '../third_party/skia/src/opts/SkBitmapProcState_matrix_repeat_neon.h ',
866 '../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp',
867 ],
868 }],
869 ],
870 },
871 { 111 {
872 'target_name': 'image_operations_bench', 112 'target_name': 'image_operations_bench',
873 'type': 'executable', 113 'type': 'executable',
874 'dependencies': [ 114 'dependencies': [
875 '../base/base.gyp:base', 115 '../base/base.gyp:base',
876 'skia', 116 'skia',
877 ], 117 ],
878 'include_dirs': [ 118 'include_dirs': [
879 '..', 119 '..',
880 ], 120 ],
881 'sources': [ 121 'sources': [
882 'ext/image_operations_bench.cc', 122 'ext/image_operations_bench.cc',
883 ], 123 ],
884 }, 124 },
885 ], 125 ],
886 'conditions': [
887 ['OS=="ios"', {
888 'targets': [
889 # The main skia_opts target does not currently work on iOS because the
890 # target architecture on iOS is determined at compile time rather than
891 # gyp time (simulator builds are x86, device builds are arm). As a
892 # temporary measure, this is a separate opts target for iOS-only, using
893 # the _none.cpp files to avoid architecture-dependent implementations.
894 {
895 'target_name': 'skia_opts_ios',
896 'type': 'static_library',
897 'include_dirs': [
898 '..',
899 'config',
900 '../third_party/skia/include/config',
901 '../third_party/skia/include/core',
902 '../third_party/skia/include/effects',
903 '../third_party/skia/include/images',
904 '../third_party/skia/include/lazy',
905 '../third_party/skia/include/pathops',
906 '../third_party/skia/include/utils',
907 '../third_party/skia/src/core',
908 ],
909 'sources': [
910 '../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp',
911 '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp',
912 '../third_party/skia/src/opts/SkUtils_opts_none.cpp',
913 ],
914 },
915 ],
916 }],
917 ],
918 } 126 }
OLDNEW
« no previous file with comments | « no previous file | skia/skia_chrome.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698