Update optimize_png_files.sh to work on msysgit bash.
[chromium-blink-merge.git] / skia / skia_library.gypi
blobfe1793f68c53e446e2942520e8db9e594a391612
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 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15   'dependencies': [
16     'skia_library_opts.gyp:skia_opts',
17     '../third_party/zlib/zlib.gyp:zlib',
18   ],
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/record.gypi',
25   ],
27   'sources': [
28     # this should likely be moved into src/utils in skia
29     '../third_party/skia/src/core/SkFlate.cpp',
30     '../third_party/skia/src/core/SkPaintOptionsAndroid.cpp',
32     '../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
33     '../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
34     '../third_party/skia/src/images/SkScaledBitmapSampler.h',
36     '../third_party/skia/src/opts/opts_check_x86.cpp',
38     '../third_party/skia/src/ports/SkFontConfigInterface_android.cpp',
39     '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
41     '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
42     '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
44     '../third_party/skia/src/fonts/SkFontMgr_indirect.cpp',
45     '../third_party/skia/src/fonts/SkRemotableFontMgr.cpp',
46     '../third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp',
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_FreeType_common.h',
51     '../third_party/skia/src/ports/SkFontConfigParser_android.cpp',
52     '../third_party/skia/src/ports/SkFontHost_mac.cpp',
53     '../third_party/skia/src/ports/SkFontHost_win.cpp',
54     '../third_party/skia/src/ports/SkFontHost_win_dw.cpp',
55     '../third_party/skia/src/ports/SkFontMgr_default_gdi.cpp',
56     '../third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp',
57     '../third_party/skia/src/ports/SkOSFile_posix.cpp',
58     '../third_party/skia/src/ports/SkOSFile_stdio.cpp',
59     '../third_party/skia/src/ports/SkOSFile_win.cpp',
60     '../third_party/skia/src/ports/SkTime_Unix.cpp',
61     '../third_party/skia/src/ports/SkTLS_pthread.cpp',
62     '../third_party/skia/src/ports/SkTLS_win.cpp',
64     '../third_party/skia/src/sfnt/SkOTTable_name.cpp',
65     '../third_party/skia/src/sfnt/SkOTTable_name.h',
66     '../third_party/skia/src/sfnt/SkOTUtils.cpp',
67     '../third_party/skia/src/sfnt/SkOTUtils.h',
69     '../third_party/skia/include/utils/mac/SkCGUtils.h',
70     '../third_party/skia/include/utils/SkDeferredCanvas.h',
71     '../third_party/skia/include/utils/SkMatrix44.h',
72     '../third_party/skia/include/utils/SkNoSaveLayerCanvas.h',
73     '../third_party/skia/src/utils/debugger/SkDebugCanvas.cpp',
74     '../third_party/skia/src/utils/debugger/SkDebugCanvas.h',
75     '../third_party/skia/src/utils/debugger/SkDrawCommand.cpp',
76     '../third_party/skia/src/utils/debugger/SkDrawCommand.h',
77     '../third_party/skia/src/utils/debugger/SkObjectParser.cpp',
78     '../third_party/skia/src/utils/debugger/SkObjectParser.h',
79     '../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp',
80     '../third_party/skia/src/utils/SkBase64.cpp',
81     '../third_party/skia/src/utils/SkBase64.h',
82     '../third_party/skia/src/utils/SkBitSet.cpp',
83     '../third_party/skia/src/utils/SkBitSet.h',
84     '../third_party/skia/src/utils/SkCanvasStack.cpp',
85     '../third_party/skia/src/utils/SkCanvasStateUtils.cpp',
86     '../third_party/skia/src/utils/SkEventTracer.cpp',
87     '../third_party/skia/src/utils/SkDeferredCanvas.cpp',
88     '../third_party/skia/src/utils/SkMatrix22.cpp',
89     '../third_party/skia/src/utils/SkMatrix22.h',
90     '../third_party/skia/src/utils/SkMatrix44.cpp',
91     '../third_party/skia/src/utils/SkNullCanvas.cpp',
92     '../third_party/skia/include/utils/SkNWayCanvas.h',
93     '../third_party/skia/src/utils/SkNWayCanvas.cpp',
94     '../third_party/skia/src/utils/SkPictureUtils.cpp',
95     '../third_party/skia/src/utils/SkProxyCanvas.cpp',
96     '../third_party/skia/src/utils/SkRTConf.cpp',
97     '../third_party/skia/include/utils/SkRTConf.h',
98     '../third_party/skia/src/utils/win/SkDWrite.h',
99     '../third_party/skia/src/utils/win/SkDWrite.cpp',
100     '../third_party/skia/src/utils/win/SkDWriteFontFileStream.cpp',
101     '../third_party/skia/src/utils/win/SkDWriteFontFileStream.h',
102     '../third_party/skia/src/utils/win/SkDWriteGeometrySink.cpp',
103     '../third_party/skia/src/utils/win/SkDWriteGeometrySink.h',
104     '../third_party/skia/src/utils/win/SkHRESULT.cpp',
106     '../third_party/skia/include/images/SkImageRef.h',
107     '../third_party/skia/include/images/SkImageRef_GlobalPool.h',
108     '../third_party/skia/include/images/SkMovie.h',
109     '../third_party/skia/include/images/SkPageFlipper.h',
111     '../third_party/skia/include/ports/SkFontConfigInterface.h',
112     '../third_party/skia/include/ports/SkFontMgr.h',
113     '../third_party/skia/include/ports/SkFontMgr_indirect.h',
114     '../third_party/skia/include/ports/SkFontStyle.h',
115     '../third_party/skia/include/ports/SkRemotableFontMgr.h',
116     '../third_party/skia/include/ports/SkTypeface_win.h',
118     '../third_party/skia/include/utils/SkNullCanvas.h',
119     '../third_party/skia/include/utils/SkPictureUtils.h',
120     '../third_party/skia/include/utils/SkProxyCanvas.h',
121   ],
122   'include_dirs': [
123     '../third_party/skia/include/core',
124     '../third_party/skia/include/effects',
125     '../third_party/skia/include/images',
126     '../third_party/skia/include/lazy',
127     '../third_party/skia/include/pathops',
128     '../third_party/skia/include/pdf',
129     '../third_party/skia/include/pipe',
130     '../third_party/skia/include/ports',
131     '../third_party/skia/include/record',
132     '../third_party/skia/include/utils',
133     '../third_party/skia/src/core',
134     '../third_party/skia/src/opts',
135     '../third_party/skia/src/image',
136     '../third_party/skia/src/ports',
137     '../third_party/skia/src/sfnt',
138     '../third_party/skia/src/utils',
139     '../third_party/skia/src/lazy',
140   ],
141   'conditions': [
142     ['skia_support_gpu != 0', {
143       'includes': [
144         '../third_party/skia/gyp/gpu.gypi',
145       ],
146       'sources': [
147         '<@(skgpu_null_gl_sources)',
148         '<@(skgpu_sources)',
149       ],
150       'include_dirs': [
151         '../third_party/skia/include/gpu',
152         '../third_party/skia/src/gpu',
153       ],
154     }],
155     ['skia_support_pdf == 0', {
156       'sources/': [
157         ['exclude', '../third_party/skia/src/pdf/']
158       ],
159     }],
160     ['skia_support_pdf == 1', {
161       'dependencies': [
162         '../third_party/sfntly/sfntly.gyp:sfntly',
163       ],
164     }],
166     [ 'OS != "ios"', {
167       'dependencies': [
168         '../third_party/WebKit/public/blink_skia_config.gyp:blink_skia_config',
169       ],
170       'export_dependent_settings': [
171         '../third_party/WebKit/public/blink_skia_config.gyp:blink_skia_config',
172       ],
173     }],
174     [ 'OS != "mac"', {
175       'sources/': [
176         ['exclude', '/mac/']
177       ],
178     }],
179     [ 'OS == "android" and target_arch == "arm"', {
180       'sources': [
181         '../third_party/skia/src/core/SkUtilsArm.cpp',
182       ],
183       'includes': [
184         '../build/android/cpufeatures.gypi',
185       ],
186     }],
187     [ 'target_arch == "arm" or target_arch == "arm64" or \
188        target_arch == "mipsel"', {
189       'sources!': [
190         '../third_party/skia/src/opts/opts_check_x86.cpp'
191       ],
192     }],
193     [ 'desktop_linux == 1 or chromeos == 1', {
194       'dependencies': [
195         '../build/linux/system.gyp:fontconfig',
196         '../build/linux/system.gyp:freetype2',
197         '../third_party/icu/icu.gyp:icuuc',
198       ],
199       'cflags': [
200         '-Wno-unused',
201         '-Wno-unused-function',
202       ],
203     }],
204     [ 'use_cairo == 1', {
205       'dependencies': [
206         '../build/linux/system.gyp:pangocairo',
207       ],
208     }],
209     [ 'OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', {
210       'sources!': [
211         '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
212         '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
213       ],
214     }],
215     [ 'OS=="win" or OS=="mac" or OS=="ios"', {
216       'sources!': [
217         '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
218         '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
219         '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
221       ],
222     }],
223     [ 'OS == "android"', {
224       'dependencies': [
225         '../third_party/expat/expat.gyp:expat',
226         '../third_party/freetype/freetype.gyp:ft2',
227       ],
228       # This exports a hard dependency because it needs to run its
229       # symlink action in order to expose the skia header files.
230       'hard_dependency': 1,
231       'include_dirs': [
232         '../third_party/expat/files/lib',
233       ],
234     }],
235     [ 'OS == "ios"', {
236       'include_dirs': [
237         '../third_party/skia/include/utils/ios',
238         '../third_party/skia/include/utils/mac',
239       ],
240       'link_settings': {
241         'libraries': [
242           '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
243         ],
244       },
245       'sources': [
246         # This file is used on both iOS and Mac, so it should be removed
247         #  from the ios and mac conditions and moved into the main sources
248         #  list.
249         '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
250       ],
251       'sources/': [
252         ['exclude', 'opts_check_x86\\.cpp$'],
253       ],
255       # The main skia_opts target does not currently work on iOS because the
256       # target architecture on iOS is determined at compile time rather than
257       # gyp time (simulator builds are x86, device builds are arm).  As a
258       # temporary measure, this is a separate opts target for iOS-only, using
259       # the _none.cpp files to avoid architecture-dependent implementations.
260       'dependencies': [
261         'skia_library_opts.gyp:skia_opts_none',
262       ],
263       'dependencies!': [
264         'skia_library_opts.gyp:skia_opts',
265       ],
266     }],
267     [ 'OS == "mac"', {
268       'direct_dependent_settings': {
269         'include_dirs': [
270           '../third_party/skia/include/utils/mac',
271         ],
272       },
273       'include_dirs': [
274         '../third_party/skia/include/utils/mac',
275       ],
276       'link_settings': {
277         'libraries': [
278           '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
279         ],
280       },
281       'sources': [
282         '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
283       ],
284     }],
285     [ 'OS == "win"', {
286       'sources!': [
287         '../third_party/skia/src/ports/SkOSFile_posix.cpp',
288         '../third_party/skia/src/ports/SkTime_Unix.cpp',
289         '../third_party/skia/src/ports/SkTLS_pthread.cpp',
290       ],
291       'include_dirs': [
292         '../third_party/skia/include/utils/win',
293         '../third_party/skia/src/utils/win',
294       ],
295     },{ # not 'OS == "win"'
296       'sources!': [
297         '../third_party/skia/src/ports/SkFontHost_win_dw.cpp',
298         '../third_party/skia/src/ports/SkFontMgr_default_gdi.cpp',
299         '../third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp',
301         '../third_party/skia/src/utils/win/SkDWrite.h',
302         '../third_party/skia/src/utils/win/SkDWrite.cpp',
303         '../third_party/skia/src/utils/win/SkDWriteFontFileStream.cpp',
304         '../third_party/skia/src/utils/win/SkDWriteFontFileStream.h',
305         '../third_party/skia/src/utils/win/SkDWriteGeometrySink.cpp',
306         '../third_party/skia/src/utils/win/SkDWriteGeometrySink.h',
307         '../third_party/skia/src/utils/win/SkHRESULT.cpp',
308       ],
309     }],
310     # TODO(scottmg): http://crbug.com/177306
311     ['clang==1', {
312       'xcode_settings': {
313         'WARNING_CFLAGS!': [
314           # Don't warn about string->bool used in asserts.
315           '-Wstring-conversion',
316         ],
317       },
318       'cflags!': [
319         '-Wstring-conversion',
320       ],
321     }],
322   ],
323   'target_conditions': [
324     # Pull in specific Mac files for iOS (which have been filtered out
325     # by file name rules).
326     [ 'OS == "ios"', {
327       'sources/': [
328         ['include', 'SkFontHost_mac\\.cpp$',],
329         ['include', 'SkStream_mac\\.cpp$',],
330         ['include', 'SkCreateCGImageRef\\.cpp$',],
331       ],
332     }],
333   ],
335   'direct_dependent_settings': {
336     'include_dirs': [
337       #temporary until we can hide SkFontHost
338       '../third_party/skia/src/core',
340       '../third_party/skia/include/core',
341       '../third_party/skia/include/effects',
342       '../third_party/skia/include/pdf',
343       '../third_party/skia/include/gpu',
344       '../third_party/skia/include/lazy',
345       '../third_party/skia/include/pathops',
346       '../third_party/skia/include/pipe',
347       '../third_party/skia/include/ports',
348       '../third_party/skia/include/utils',
349     ],
350   },