Simple Cache: transactional index in subdirectory
[chromium-blink-merge.git] / skia / skia_library.gypi
blob267f586a6965c7d3a2d72a1d537af245b3f62ac3
1 # 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.
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.
10   'dependencies': [
11     'skia_library_opts.gyp:skia_opts',
12     '../third_party/zlib/zlib.gyp:zlib',
13   ],
15   'variables': {
16     'variables': {
17       'conditions': [
18         ['OS== "ios"', {
19           'skia_support_gpu': 0,
20         }, {
21           'skia_support_gpu': 1,
22         }],
23         ['OS=="ios" or enable_printing == 0', {
24           'skia_support_pdf': 0,
25         }, {
26           'skia_support_pdf': 1,
27         }],
28       ],
29     },
30     'skia_support_gpu': '<(skia_support_gpu)',
31     'skia_support_pdf': '<(skia_support_pdf)',
33     # These two set the paths so we can include skia/gyp/core.gypi
34     'skia_src_path': '../third_party/skia/src',
35     'skia_include_path': '../third_party/skia/include',
37     # This list will contain all defines that also need to be exported to
38     # dependent components.
39     'skia_export_defines': [
40       'SK_ENABLE_INST_COUNT=0',
41       'SK_SUPPORT_GPU=<(skia_support_gpu)',
42       'GR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"',
43     ],
45     'default_font_cache_limit': '(20*1024*1024)',
47     'conditions': [
48       ['OS== "android"', {
49         # Android devices are typically more memory constrained, so
50         # default to a smaller glyph cache (it may be overriden at runtime
51         # when the renderer starts up, depending on the actual device memory).
52         'default_font_cache_limit': '(1*1024*1024)',
53         'skia_export_defines': [
54           'SK_BUILD_FOR_ANDROID',
55           'USE_CHROMIUM_SKIA',
56         ],
57       }],
58     ],
59   },
61   'includes': [
62     '../third_party/skia/gyp/core.gypi',
63     '../third_party/skia/gyp/effects.gypi',
64     '../third_party/skia/gyp/pdf.gypi',
65   ],
67   'sources': [
68     # this should likely be moved into src/utils in skia
69     '../third_party/skia/src/core/SkFlate.cpp',
70     # We don't want to add this to Skia's core.gypi since it is
71     # Android only. Include it here and remove it for everyone
72     # but Android later.
73     '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
75     '../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
76     '../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
77     '../third_party/skia/src/images/SkScaledBitmapSampler.h',
79     '../third_party/skia/src/opts/opts_check_SSE2.cpp',
81     '../third_party/skia/src/ports/SkPurgeableMemoryBlock_none.cpp',
83     '../third_party/skia/src/ports/SkFontConfigInterface_android.cpp',
84     '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
86     '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
87     '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
89     '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
90     '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
91     '../third_party/skia/src/ports/SkFontHost_FreeType_common.h',
92     '../third_party/skia/src/ports/SkFontConfigParser_android.cpp',
93     '../third_party/skia/src/ports/SkFontHost_mac.cpp',
94     '../third_party/skia/src/ports/SkFontHost_win.cpp',
95     '../third_party/skia/src/ports/SkFontHost_win_dw.cpp',
96     '../third_party/skia/src/ports/SkFontMgr_default_gdi.cpp',
97     '../third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp',
98     '../third_party/skia/src/ports/SkOSFile_posix.cpp',
99     '../third_party/skia/src/ports/SkOSFile_stdio.cpp',
100     '../third_party/skia/src/ports/SkOSFile_win.cpp',
101     '../third_party/skia/src/ports/SkThread_pthread.cpp',
102     '../third_party/skia/src/ports/SkThread_win.cpp',
103     '../third_party/skia/src/ports/SkTime_Unix.cpp',
104     '../third_party/skia/src/ports/SkTLS_pthread.cpp',
105     '../third_party/skia/src/ports/SkTLS_win.cpp',
107     '../third_party/skia/src/sfnt/SkOTTable_name.cpp',
108     '../third_party/skia/src/sfnt/SkOTTable_name.h',
109     '../third_party/skia/src/sfnt/SkOTUtils.cpp',
110     '../third_party/skia/src/sfnt/SkOTUtils.h',
112     '../third_party/skia/include/utils/mac/SkCGUtils.h',
113     '../third_party/skia/include/utils/SkDeferredCanvas.h',
114     '../third_party/skia/include/utils/SkMatrix44.h',
115     '../third_party/skia/src/utils/debugger/SkDebugCanvas.cpp',
116     '../third_party/skia/src/utils/debugger/SkDebugCanvas.h',
117     '../third_party/skia/src/utils/debugger/SkDrawCommand.cpp',
118     '../third_party/skia/src/utils/debugger/SkDrawCommand.h',
119     '../third_party/skia/src/utils/debugger/SkObjectParser.cpp',
120     '../third_party/skia/src/utils/debugger/SkObjectParser.h',
121     '../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp',
122     '../third_party/skia/src/utils/SkBase64.cpp',
123     '../third_party/skia/src/utils/SkBase64.h',
124     '../third_party/skia/src/utils/SkBitSet.cpp',
125     '../third_party/skia/src/utils/SkBitSet.h',
126     '../third_party/skia/src/utils/SkCanvasStack.cpp',
127     '../third_party/skia/src/utils/SkCanvasStateUtils.cpp',
128     '../third_party/skia/src/utils/SkDeferredCanvas.cpp',
129     '../third_party/skia/src/utils/SkMatrix44.cpp',
130     '../third_party/skia/src/utils/SkNullCanvas.cpp',
131     '../third_party/skia/include/utils/SkNWayCanvas.h',
132     '../third_party/skia/src/utils/SkNWayCanvas.cpp',
133     '../third_party/skia/src/utils/SkPictureUtils.cpp',
134     '../third_party/skia/src/utils/SkProxyCanvas.cpp',
135     '../third_party/skia/src/utils/SkRTConf.cpp',
136     '../third_party/skia/include/utils/SkRTConf.h',
137     '../third_party/skia/src/utils/win/SkDWriteFontFileStream.cpp',
138     '../third_party/skia/src/utils/win/SkDWriteFontFileStream.h',
139     '../third_party/skia/src/utils/win/SkDWriteGeometrySink.cpp',
140     '../third_party/skia/src/utils/win/SkDWriteGeometrySink.h',
141     '../third_party/skia/src/utils/win/SkHRESULT.cpp',
143     '../third_party/skia/include/ports/SkTypeface_win.h',
145     '../third_party/skia/include/images/SkImageRef.h',
146     '../third_party/skia/include/images/SkImageRef_GlobalPool.h',
147     '../third_party/skia/include/images/SkMovie.h',
148     '../third_party/skia/include/images/SkPageFlipper.h',
150     '../third_party/skia/include/utils/SkNullCanvas.h',
151     '../third_party/skia/include/utils/SkPictureUtils.h',
152     '../third_party/skia/include/utils/SkProxyCanvas.h',
153   ],
154   'include_dirs': [
155     '..',
156     'config',
157     '../third_party/skia/include/config',
158     '../third_party/skia/include/core',
159     '../third_party/skia/include/effects',
160     '../third_party/skia/include/images',
161     '../third_party/skia/include/lazy',
162     '../third_party/skia/include/pathops',
163     '../third_party/skia/include/pdf',
164     '../third_party/skia/include/pipe',
165     '../third_party/skia/include/ports',
166     '../third_party/skia/include/utils',
167     '../third_party/skia/src/core',
168     '../third_party/skia/src/image',
169     '../third_party/skia/src/ports',
170     '../third_party/skia/src/sfnt',
171     '../third_party/skia/src/utils',
172     '../third_party/skia/src/lazy',
173   ],
174   'conditions': [
175     ['skia_support_gpu != 0', {
176       'includes': [
177         '../third_party/skia/gyp/gpu.gypi',
178       ],
179       'sources': [
180         '<@(skgpu_sources)',
181       ],
182       'include_dirs': [
183         '../third_party/skia/include/gpu',
184         '../third_party/skia/src/gpu',
185       ],
186     }],
187     ['skia_support_pdf == 0', {
188       'sources/': [
189         ['exclude', '../third_party/skia/src/pdf/']
190       ],
191     }],
192     ['skia_support_pdf == 1', {
193       'dependencies': [
194         '../third_party/sfntly/sfntly.gyp:sfntly',
195       ],
196     }],
198     #Settings for text blitting, chosen to approximate the system browser.
199     [ 'OS == "linux"', {
200       'defines': [
201         'SK_GAMMA_EXPONENT=1.2',
202         'SK_GAMMA_CONTRAST=0.2',
203       ],
204     }],
205     ['OS == "android"', {
206       'defines': [
207         'SK_GAMMA_APPLY_TO_A8',
208         'SK_GAMMA_EXPONENT=1.4',
209         'SK_GAMMA_CONTRAST=0.0',
210       ],
211     }],
212     ['OS == "win"', {
213       'defines': [
214         'SK_GAMMA_SRGB',
215         'SK_GAMMA_CONTRAST=0.5',
216       ],
217     }],
218     ['OS == "mac"', {
219       'defines': [
220         'SK_GAMMA_SRGB',
221         'SK_GAMMA_CONTRAST=0.0',
222       ],
223     }],
225     # For POSIX platforms, prefer the Mutex implementation provided by Skia
226     # since it does not generate static initializers.
227     [ 'OS == "android" or OS == "linux" or OS == "mac" or OS == "ios"', {
228       'defines+': [
229         'SK_USE_POSIX_THREADS',
230       ],
231       'direct_dependent_settings': {
232         'defines': [
233           'SK_USE_POSIX_THREADS',
234         ],
235       },
236     }],
238     [ 'OS != "android"', {
239       'sources!': [
240         '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
241       ],
242     }],
243     [ 'OS != "ios"', {
244       'dependencies': [
245         '../third_party/WebKit/public/blink_skia_config.gyp:blink_skia_config',
246       ],
247       'export_dependent_settings': [
248         '../third_party/WebKit/public/blink_skia_config.gyp:blink_skia_config',
249       ],
250     }],
251     [ 'OS != "mac"', {
252       'sources/': [
253         ['exclude', '/mac/']
254       ],
255     }],
256     [ 'target_arch == "arm" and arm_version >= 7 and arm_neon == 1', {
257       'defines': [
258         '__ARM_HAVE_NEON',
259       ],
260     }],
261     [ 'target_arch == "arm" and arm_version >= 7 and arm_neon_optional == 1', {
262       'defines': [
263         '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
264       ],
265     }],
266     [ 'OS == "android" and target_arch == "arm"', {
267       'sources': [
268         '../third_party/skia/src/core/SkUtilsArm.cpp',
269       ],
270       'includes': [
271         '../build/android/cpufeatures.gypi',
272       ],
273     }],
274     [ 'target_arch == "arm" or target_arch == "mipsel"', {
275       'sources!': [
276         '../third_party/skia/src/opts/opts_check_SSE2.cpp'
277       ],
278     }],
279     [ 'use_glib == 1', {
280       'dependencies': [
281         '../build/linux/system.gyp:fontconfig',
282         '../build/linux/system.gyp:freetype2',
283         '../build/linux/system.gyp:pangocairo',
284         '../third_party/icu/icu.gyp:icuuc',
285       ],
286       'cflags': [
287         '-Wno-unused',
288         '-Wno-unused-function',
289       ],
290     }],
291     [ 'use_glib == 0', {
292       'sources!': [
293         '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
294         '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
295       ],
296     }],
297     [ 'use_glib == 0 and OS != "android"', {
298       'sources!': [
299         '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
300         '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
301         '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
303       ],
304     }],
305     [ 'OS == "android"', {
306       'dependencies': [
307         '../third_party/expat/expat.gyp:expat',
308         '../third_party/freetype/freetype.gyp:ft2',
309       ],
310       # This exports a hard dependency because it needs to run its
311       # symlink action in order to expose the skia header files.
312       'hard_dependency': 1,
313       'include_dirs': [
314         '../third_party/expat/files/lib',
315       ],
316     }],
317     [ 'OS == "ios"', {
318       'defines': [
319         'SK_BUILD_FOR_IOS',
320         'SK_USE_MAC_CORE_TEXT',
321       ],
322       'include_dirs': [
323         '../third_party/skia/include/utils/ios',
324         '../third_party/skia/include/utils/mac',
325       ],
326       'link_settings': {
327         'libraries': [
328           '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
329         ],
330       },
331       'sources': [
332         # This file is used on both iOS and Mac, so it should be removed
333         #  from the ios and mac conditions and moved into the main sources
334         #  list.
335         '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
336       ],
337       'sources/': [
338         ['exclude', 'opts_check_SSE2\\.cpp$'],
339       ],
341       # The main skia_opts target does not currently work on iOS because the
342       # target architecture on iOS is determined at compile time rather than
343       # gyp time (simulator builds are x86, device builds are arm).  As a
344       # temporary measure, this is a separate opts target for iOS-only, using
345       # the _none.cpp files to avoid architecture-dependent implementations.
346       'dependencies': [
347         'skia_library_opts.gyp:skia_opts_none',
348       ],
349       'dependencies!': [
350         'skia_library_opts.gyp:skia_opts',
351       ],
352     }],
353     [ 'OS == "mac"', {
354       'defines': [
355         'SK_BUILD_FOR_MAC',
356         'SK_USE_MAC_CORE_TEXT',
357       ],
358       'direct_dependent_settings': {
359         'include_dirs': [
360           '../third_party/skia/include/utils/mac',
361         ],
362       },
363       'include_dirs': [
364         '../third_party/skia/include/utils/mac',
365       ],
366       'link_settings': {
367         'libraries': [
368           '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
369         ],
370       },
371       'sources': [
372         '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
373       ],
374     }],
375     [ 'OS == "win"', {
376       'sources!': [
377         '../third_party/skia/src/ports/SkOSFile_posix.cpp',
378         '../third_party/skia/src/ports/SkThread_pthread.cpp',
379         '../third_party/skia/src/ports/SkTime_Unix.cpp',
380         '../third_party/skia/src/ports/SkTLS_pthread.cpp',
381       ],
382       'include_dirs': [
383         '../third_party/skia/include/utils/win',
384         '../third_party/skia/src/utils/win',
385       ],
386       'defines': [
387         'SK_FONTHOST_USES_FONTMGR',
388       ],
389     },{ # not 'OS == "win"'
390       'sources!': [
391         '../third_party/skia/src/ports/SkFontHost_win_dw.cpp',
392         '../third_party/skia/src/ports/SkFontMgr_default_gdi.cpp',
394         '../third_party/skia/src/utils/win/SkDWriteFontFileStream.cpp',
395         '../third_party/skia/src/utils/win/SkDWriteFontFileStream.h',
396         '../third_party/skia/src/utils/win/SkDWriteGeometrySink.cpp',
397         '../third_party/skia/src/utils/win/SkDWriteGeometrySink.h',
398         '../third_party/skia/src/utils/win/SkHRESULT.cpp',
399       ],
400     }],
401     # TODO(scottmg): http://crbug.com/177306
402     ['clang==1', {
403       'xcode_settings': {
404         'WARNING_CFLAGS!': [
405           # Don't warn about string->bool used in asserts.
406           '-Wstring-conversion',
407         ],
408       },
409       'cflags!': [
410         '-Wstring-conversion',
411       ],
412     }],
413   ],
414   'target_conditions': [
415     # Pull in specific Mac files for iOS (which have been filtered out
416     # by file name rules).
417     [ 'OS == "ios"', {
418       'sources/': [
419         ['include', 'SkFontHost_mac\\.cpp$',],
420         ['include', 'SkStream_mac\\.cpp$',],
421         ['include', 'SkCreateCGImageRef\\.cpp$',],
422       ],
423     }],
424   ],
426   'defines': [
427     '<@(skia_export_defines)',
429     # this flag can be removed entirely once this has baked for a while
430     'SK_ALLOW_OVER_32K_BITMAPS',
432     # skia uses static initializers to initialize the serialization logic
433     # of its "pictures" library. This is currently not used in chrome; if
434     # it ever gets used the processes that use it need to call
435     # SkGraphics::Init().
436     'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0',
438     # Disable this check because it is too strict for some Chromium-specific
439     # subclasses of SkPixelRef. See bug: crbug.com/171776.
440     'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK',
442     'IGNORE_ROT_AA_RECT_OPT',
444     'SKIA_IGNORE_GPU_MIPMAPS',
446     # this flag forces Skia not to use typographic metrics with GDI.
447     'SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS',
449     'SK_DEFAULT_FONT_CACHE_LIMIT=<(default_font_cache_limit)',
450   ],
452   'direct_dependent_settings': {
453     'include_dirs': [
454       #temporary until we can hide SkFontHost
455       '../third_party/skia/src/core',
457       'config',
458       '../third_party/skia/include/config',
459       '../third_party/skia/include/core',
460       '../third_party/skia/include/effects',
461       '../third_party/skia/include/pdf',
462       '../third_party/skia/include/gpu',
463       '../third_party/skia/include/lazy',
464       '../third_party/skia/include/pathops',
465       '../third_party/skia/include/pipe',
466       '../third_party/skia/include/ports',
467       '../third_party/skia/include/utils',
468     ],
469     'defines': [
470       '<@(skia_export_defines)',
471     ],
472   },