Rationalize and fix chromium android linker histogram recording.
[chromium-blink-merge.git] / skia / skia_library.gypi
blob2df089e6f953e49f14c3f451e66504f69f5c30af
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/utils.gypi',
25   ],
27   'sources': [
28     # this should likely be moved into src/utils in skia
29     '../third_party/skia/src/core/SkFlate.cpp',
31     '../third_party/skia/src/ports/SkImageDecoder_empty.cpp',
32     '../third_party/skia/src/images/SkScaledBitmapSampler.cpp',
33     '../third_party/skia/src/images/SkScaledBitmapSampler.h',
35     '../third_party/skia/src/opts/opts_check_x86.cpp',
37     '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
39     '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
40     '../third_party/skia/src/ports/SkFontHost_fontconfig.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',
46     '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
47     '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
48     '../third_party/skia/src/ports/SkFontHost_FreeType_common.h',
49     '../third_party/skia/src/ports/SkFontConfigParser_android.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_win_dw.cpp',
54     '../third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp',
55     '../third_party/skia/src/ports/SkOSFile_posix.cpp',
56     '../third_party/skia/src/ports/SkOSFile_stdio.cpp',
57     '../third_party/skia/src/ports/SkOSFile_win.cpp',
58     '../third_party/skia/src/ports/SkScalerContext_win_dw.cpp',
59     '../third_party/skia/src/ports/SkScalerContext_win_dw.h',
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',
63     '../third_party/skia/src/ports/SkTypeface_win_dw.cpp',
64     '../third_party/skia/src/ports/SkTypeface_win_dw.h',
66     '../third_party/skia/src/sfnt/SkOTTable_name.cpp',
67     '../third_party/skia/src/sfnt/SkOTTable_name.h',
68     '../third_party/skia/src/sfnt/SkOTUtils.cpp',
69     '../third_party/skia/src/sfnt/SkOTUtils.h',
71     '../third_party/skia/src/utils/debugger/SkDebugCanvas.cpp',
72     '../third_party/skia/src/utils/debugger/SkDebugCanvas.h',
73     '../third_party/skia/src/utils/debugger/SkDrawCommand.cpp',
74     '../third_party/skia/src/utils/debugger/SkDrawCommand.h',
75     '../third_party/skia/src/utils/debugger/SkObjectParser.cpp',
76     '../third_party/skia/src/utils/debugger/SkObjectParser.h',
78     '../third_party/skia/include/images/SkMovie.h',
79     '../third_party/skia/include/images/SkPageFlipper.h',
81     '../third_party/skia/include/ports/SkFontConfigInterface.h',
82     '../third_party/skia/include/ports/SkFontMgr.h',
83     '../third_party/skia/include/ports/SkFontMgr_indirect.h',
84     '../third_party/skia/include/ports/SkFontStyle.h',
85     '../third_party/skia/include/ports/SkRemotableFontMgr.h',
86     '../third_party/skia/include/ports/SkTypeface_win.h',
87   ],
89   # Exclude all unused files in skia utils.gypi file
90   'sources!': [
91   '../third_party/skia/src/utils/SkCondVar.cpp',
92   '../third_party/skia/src/utils/SkCondVar.h',
93   '../third_party/skia/src/utils/SkRunnable.h',
95   '../third_party/skia/include/utils/SkBoundaryPatch.h',
96   '../third_party/skia/include/utils/SkFrontBufferedStream.h',
97   '../third_party/skia/include/utils/SkCamera.h',
98   '../third_party/skia/include/utils/SkCanvasStateUtils.h',
99   '../third_party/skia/include/utils/SkCubicInterval.h',
100   '../third_party/skia/include/utils/SkCullPoints.h',
101   '../third_party/skia/include/utils/SkDebugUtils.h',
102   '../third_party/skia/include/utils/SkDumpCanvas.h',
103   '../third_party/skia/include/utils/SkEventTracer.h',
104   '../third_party/skia/include/utils/SkInterpolator.h',
105   '../third_party/skia/include/utils/SkLayer.h',
106   '../third_party/skia/include/utils/SkMeshUtils.h',
107   '../third_party/skia/include/utils/SkNinePatch.h',
108   '../third_party/skia/include/utils/SkParse.h',
109   '../third_party/skia/include/utils/SkParsePaint.h',
110   '../third_party/skia/include/utils/SkParsePath.h',
111   '../third_party/skia/include/utils/SkRandom.h',
112   '../third_party/skia/include/utils/SkWGL.h',
114   '../third_party/skia/src/utils/SkBitmapHasher.cpp',
115   '../third_party/skia/src/utils/SkBitmapHasher.h',
116   '../third_party/skia/src/utils/SkBoundaryPatch.cpp',
117   '../third_party/skia/src/utils/SkFrontBufferedStream.cpp',
118   '../third_party/skia/src/utils/SkCamera.cpp',
119   '../third_party/skia/src/utils/SkCanvasStack.h',
120   '../third_party/skia/src/utils/SkCubicInterval.cpp',
121   '../third_party/skia/src/utils/SkCullPoints.cpp',
122   '../third_party/skia/src/utils/SkDumpCanvas.cpp',
123   '../third_party/skia/src/utils/SkFloatUtils.h',
124   '../third_party/skia/src/utils/SkGatherPixelRefsAndRects.cpp',
125   '../third_party/skia/src/utils/SkGatherPixelRefsAndRects.h',
126   '../third_party/skia/src/utils/SkInterpolator.cpp',
127   '../third_party/skia/src/utils/SkLayer.cpp',
128   '../third_party/skia/src/utils/SkMD5.cpp',
129   '../third_party/skia/src/utils/SkMD5.h',
130   '../third_party/skia/src/utils/SkMeshUtils.cpp',
131   '../third_party/skia/src/utils/SkNinePatch.cpp',
132   '../third_party/skia/src/utils/SkOSFile.cpp',
133   '../third_party/skia/src/utils/SkParse.cpp',
134   '../third_party/skia/src/utils/SkParseColor.cpp',
135   '../third_party/skia/src/utils/SkParsePath.cpp',
136   '../third_party/skia/src/utils/SkPathUtils.cpp',
137   '../third_party/skia/src/utils/SkSHA1.cpp',
138   '../third_party/skia/src/utils/SkSHA1.h',
139   '../third_party/skia/src/utils/SkThreadUtils.h',
140   '../third_party/skia/src/utils/SkThreadUtils_pthread.cpp',
141   '../third_party/skia/src/utils/SkThreadUtils_pthread.h',
142   '../third_party/skia/src/utils/SkThreadUtils_pthread_linux.cpp',
143   '../third_party/skia/src/utils/SkThreadUtils_pthread_mach.cpp',
144   '../third_party/skia/src/utils/SkThreadUtils_pthread_other.cpp',
145   '../third_party/skia/src/utils/SkThreadUtils_win.cpp',
146   '../third_party/skia/src/utils/SkThreadUtils_win.h',
147   '../third_party/skia/src/utils/SkTFitsIn.h',
148   '../third_party/skia/src/utils/SkTLogic.h',
150 #windows
151   '../third_party/skia/include/utils/win/SkAutoCoInitialize.h',
152   '../third_party/skia/include/utils/win/SkHRESULT.h',
153   '../third_party/skia/include/utils/win/SkIStream.h',
154   '../third_party/skia/include/utils/win/SkTScopedComPtr.h',
155   '../third_party/skia/src/utils/win/SkAutoCoInitialize.cpp',
156   '../third_party/skia/src/utils/win/SkIStream.cpp',
157   '../third_party/skia/src/utils/win/SkWGL_win.cpp',
159 #testing
160   '../third_party/skia/src/fonts/SkGScalerContext.cpp',
161   '../third_party/skia/src/fonts/SkGScalerContext.h',
162   ],
164   'include_dirs': [
165     '../third_party/skia/include/core',
166     '../third_party/skia/include/effects',
167     '../third_party/skia/include/images',
168     '../third_party/skia/include/lazy',
169     '../third_party/skia/include/pathops',
170     '../third_party/skia/include/pdf',
171     '../third_party/skia/include/pipe',
172     '../third_party/skia/include/ports',
173     '../third_party/skia/include/record',
174     '../third_party/skia/include/utils',
175     '../third_party/skia/src/core',
176     '../third_party/skia/src/opts',
177     '../third_party/skia/src/image',
178     '../third_party/skia/src/ports',
179     '../third_party/skia/src/sfnt',
180     '../third_party/skia/src/utils',
181     '../third_party/skia/src/lazy',
182   ],
183   'conditions': [
184     ['skia_support_gpu != 0', {
185       'includes': [
186         '../third_party/skia/gyp/gpu.gypi',
187       ],
188       'sources': [
189         '<@(skgpu_null_gl_sources)',
190         '<@(skgpu_sources)',
191       ],
192       'include_dirs': [
193         '../third_party/skia/include/gpu',
194         '../third_party/skia/src/gpu',
195       ],
196     }],
197     ['skia_support_pdf == 0', {
198       'sources/': [
199         ['exclude', '../third_party/skia/src/pdf/']
200       ],
201     }],
202     ['skia_support_pdf == 1', {
203       'dependencies': [
204         '../third_party/sfntly/sfntly.gyp:sfntly',
205       ],
206     }],
208     [ 'OS != "ios"', {
209       'dependencies': [
210         '../third_party/WebKit/public/blink_skia_config.gyp:blink_skia_config',
211       ],
212       'export_dependent_settings': [
213         '../third_party/WebKit/public/blink_skia_config.gyp:blink_skia_config',
214       ],
215     }],
216     [ 'OS != "mac"', {
217       'sources/': [
218         ['exclude', '/mac/']
219       ],
220     }],
221     [ 'OS == "android" and target_arch == "arm"', {
222       'sources': [
223         '../third_party/skia/src/core/SkUtilsArm.cpp',
224       ],
225       'includes': [
226         '../build/android/cpufeatures.gypi',
227       ],
228     }],
229     [ 'target_arch == "arm" or target_arch == "arm64" or \
230        target_arch == "mipsel" or target_arch == "mips64el"', {
231       'sources!': [
232         '../third_party/skia/src/opts/opts_check_x86.cpp'
233       ],
234     }],
235     [ 'desktop_linux == 1 or chromeos == 1', {
236       'dependencies': [
237         '../build/linux/system.gyp:fontconfig',
238         '../build/linux/system.gyp:freetype2',
239         '../third_party/icu/icu.gyp:icuuc',
240       ],
241       'cflags': [
242         '-Wno-unused',
243         '-Wno-unused-function',
244       ],
245     }],
246     [ 'use_cairo == 1', {
247       'dependencies': [
248         '../build/linux/system.gyp:pangocairo',
249       ],
250     }],
251     [ 'OS=="win" or OS=="mac" or OS=="ios" or OS=="android"', {
252       'sources!': [
253         '../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp',
254         '../third_party/skia/src/ports/SkFontHost_fontconfig.cpp',
255         '../third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp',
256       ],
257     }],
258     [ 'OS=="win" or OS=="mac" or OS=="ios"', {
259       'sources!': [
260         '../third_party/skia/src/ports/SkFontHost_FreeType.cpp',
261         '../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp',
263       ],
264     }],
265     [ 'OS == "android"', {
266       'dependencies': [
267         '../third_party/expat/expat.gyp:expat',
268         '../third_party/freetype/freetype.gyp:ft2',
269       ],
270       # This exports a hard dependency because it needs to run its
271       # symlink action in order to expose the skia header files.
272       'hard_dependency': 1,
273       'include_dirs': [
274         '../third_party/expat/files/lib',
275       ],
276     }],
277     [ 'OS == "ios"', {
278       'include_dirs': [
279         '../third_party/skia/include/utils/ios',
280         '../third_party/skia/include/utils/mac',
281       ],
282       'link_settings': {
283         'libraries': [
284           '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework',
285         ],
286       },
287       'sources': [
288         # This file is used on both iOS and Mac, so it should be removed
289         #  from the ios and mac conditions and moved into the main sources
290         #  list.
291         '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
292       ],
293       'sources/': [
294         ['exclude', 'opts_check_x86\\.cpp$'],
295       ],
297       # The main skia_opts target does not currently work on iOS because the
298       # target architecture on iOS is determined at compile time rather than
299       # gyp time (simulator builds are x86, device builds are arm).  As a
300       # temporary measure, this is a separate opts target for iOS-only, using
301       # the _none.cpp files to avoid architecture-dependent implementations.
302       'dependencies': [
303         'skia_library_opts.gyp:skia_opts_none',
304       ],
305       'dependencies!': [
306         'skia_library_opts.gyp:skia_opts',
307       ],
308     }],
309     [ 'OS == "mac"', {
310       'direct_dependent_settings': {
311         'include_dirs': [
312           '../third_party/skia/include/utils/mac',
313         ],
314       },
315       'include_dirs': [
316         '../third_party/skia/include/utils/mac',
317       ],
318       'link_settings': {
319         'libraries': [
320           '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
321         ],
322       },
323       'sources': [
324         '../third_party/skia/src/utils/mac/SkStream_mac.cpp',
325       ],
326     }],
327     [ 'OS == "win"', {
328       'sources!': [
329         '../third_party/skia/src/ports/SkOSFile_posix.cpp',
330         '../third_party/skia/src/ports/SkTime_Unix.cpp',
331         '../third_party/skia/src/ports/SkTLS_pthread.cpp',
332       ],
333       'include_dirs': [
334         '../third_party/skia/include/utils/win',
335         '../third_party/skia/src/utils/win',
336       ],
337     },{ # not 'OS == "win"'
338       'sources!': [
339         '../third_party/skia/src/ports/SkFontMgr_win_dw.cpp',
340         '../third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp',
341         '../third_party/skia/src/ports/SkScalerContext_win_dw.cpp',
342         '../third_party/skia/src/ports/SkScalerContext_win_dw.h',
343         '../third_party/skia/src/ports/SkTypeface_win_dw.cpp',
344         '../third_party/skia/src/ports/SkTypeface_win_dw.h',
346         '../third_party/skia/src/utils/win/SkDWrite.h',
347         '../third_party/skia/src/utils/win/SkDWrite.cpp',
348         '../third_party/skia/src/utils/win/SkDWriteFontFileStream.cpp',
349         '../third_party/skia/src/utils/win/SkDWriteFontFileStream.h',
350         '../third_party/skia/src/utils/win/SkDWriteGeometrySink.cpp',
351         '../third_party/skia/src/utils/win/SkDWriteGeometrySink.h',
352         '../third_party/skia/src/utils/win/SkHRESULT.cpp',
353       ],
354     }],
355   ],
356   'target_conditions': [
357     # Pull in specific Mac files for iOS (which have been filtered out
358     # by file name rules).
359     [ 'OS == "ios"', {
360       'sources/': [
361         ['include', 'SkFontHost_mac\\.cpp$',],
362         ['include', 'SkStream_mac\\.cpp$',],
363         ['include', 'SkCreateCGImageRef\\.cpp$',],
364       ],
365     }],
366   ],
368   'direct_dependent_settings': {
369     'include_dirs': [
370       #temporary until we can hide SkFontHost
371       '../third_party/skia/src/core',
373       '../third_party/skia/include/core',
374       '../third_party/skia/include/effects',
375       '../third_party/skia/include/pdf',
376       '../third_party/skia/include/gpu',
377       '../third_party/skia/include/lazy',
378       '../third_party/skia/include/pathops',
379       '../third_party/skia/include/pipe',
380       '../third_party/skia/include/ports',
381       '../third_party/skia/include/utils',
382     ],
383   },