Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / platform / blink_platform.gyp
1 #
2 # Copyright (C) 2013 Google Inc. All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
6 # met:
7 #
8 #     * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 #     * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
13 # distribution.
14 #     * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #
30 {
31   'includes': [
32     '../build/features.gypi',
33     '../build/scripts/scripts.gypi',
34     '../build/win/precompile.gypi',
35     'blink_platform.gypi',
36   ],
37   'targets': [{
38     'target_name': 'blink_common',
39     'type': '<(component)',
40     'variables': { 'enable_wexit_time_destructors': 1 },
41     'dependencies': [
42       '../config.gyp:config',
43       '../wtf/wtf.gyp:wtf',
44       # FIXME: Can we remove the dependency on Skia?
45       '<(DEPTH)/skia/skia.gyp:skia',
46     ],
47     'all_dependent_settings': {
48       'include_dirs': [
49         '..',
50       ],
51     },
52     'export_dependent_settings': [
53       '<(DEPTH)/skia/skia.gyp:skia',
54     ],
55     'defines': [
56       'BLINK_COMMON_IMPLEMENTATION=1',
57       'INSIDE_BLINK',
58     ],
59     'sources': [
60       'exported/WebCString.cpp',
61       'exported/WebString.cpp',
62       'exported/WebCommon.cpp',
63     ],
64   },
65   {
66     'target_name': 'blink_prerequisites',
67     'type': 'none',
68     'conditions': [
69       ['OS=="mac"', {
70         'direct_dependent_settings': {
71           'defines': [
72             # Chromium's version of WebCore includes the following Objective-C
73             # classes. The system-provided WebCore framework may also provide
74             # these classes. Because of the nature of Objective-C binding
75             # (dynamically at runtime), it's possible for the
76             # Chromium-provided versions to interfere with the system-provided
77             # versions.  This may happen when a system framework attempts to
78             # use core.framework, such as when converting an HTML-flavored
79             # string to an NSAttributedString.  The solution is to force
80             # Objective-C class names that would conflict to use alternate
81             # names.
82             #
83             # This list will hopefully shrink but may also grow.  Its
84             # performance is monitored by the "Check Objective-C Rename"
85             # postbuild step, and any suspicious-looking symbols not handled
86             # here or whitelisted in that step will cause a build failure.
87             #
88             # If this is unhandled, the console will receive log messages
89             # such as:
90             # com.google.Chrome[] objc[]: Class ScrollbarPrefsObserver is implemented in both .../Google Chrome.app/Contents/Versions/.../Google Chrome Helper.app/Contents/MacOS/../../../Google Chrome Framework.framework/Google Chrome Framework and /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore. One of the two will be used. Which one is undefined.
91             'WebCascadeList=ChromiumWebCoreObjCWebCascadeList',
92             'WebFontCache=ChromiumWebCoreObjCWebFontCache',
93             'WebScrollAnimationHelperDelegate=ChromiumWebCoreObjCWebScrollAnimationHelperDelegate',
94             'WebScrollbarPainterControllerDelegate=ChromiumWebCoreObjCWebScrollbarPainterControllerDelegate',
95             'WebScrollbarPainterDelegate=ChromiumWebCoreObjCWebScrollbarPainterDelegate',
96             'WebScrollbarPartAnimation=ChromiumWebCoreObjCWebScrollbarPartAnimation',
97             'WebCoreFlippedView=ChromiumWebCoreObjCWebCoreFlippedView',
98             'WebCoreTextFieldCell=ChromiumWebCoreObjCWebCoreTextFieldCell',
99             'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver',
100           ],
101           'postbuilds': [
102             {
103               # This step ensures that any Objective-C names that aren't
104               # redefined to be "safe" above will cause a build failure.
105               'postbuild_name': 'Check Objective-C Rename',
106               'variables': {
107                 'class_whitelist_regex':
108                     'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView|ScrollerStyleObserver',
109                 'category_whitelist_regex':
110                     'TCMInterposing|ScrollAnimatorChromiumMacExt|WebCoreTheme',
111               },
112               'action': [
113                 '../build/scripts/check_objc_rename.sh',
114                 '<(class_whitelist_regex)',
115                 '<(category_whitelist_regex)',
116               ],
117             },
118           ],
119         },
120       }],
121     ],
122   },
123   {
124     'target_name': 'blink_platform',
125     'type': '<(component)',
126     'dependencies': [
127       '../config.gyp:config',
128       '../wtf/wtf.gyp:wtf',
129       'blink_common',
130       'blink_prerequisites',
131       '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
132       '<(DEPTH)/skia/skia.gyp:skia',
133       '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
134       '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
135       '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
136       '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
137       '<(DEPTH)/third_party/ots/ots.gyp:ots',
138       '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
139       '<(DEPTH)/url/url.gyp:url_lib',
140       '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
141       'platform_generated.gyp:make_platform_generated',
142       '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
143       '<(libjpeg_gyp_path):libjpeg',
144     ],
145     'export_dependent_settings': [
146       '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
147       '<(DEPTH)/skia/skia.gyp:skia',
148       '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
149       '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
150       '<(DEPTH)/third_party/ots/ots.gyp:ots',
151       '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
152       '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
153       '<(DEPTH)/url/url.gyp:url_lib',
154       '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
155       '<(libjpeg_gyp_path):libjpeg',
156     ],
157     'defines': [
158       'BLINK_PLATFORM_IMPLEMENTATION=1',
159       'INSIDE_BLINK',
160     ],
161     'include_dirs': [
162       '<(angle_path)/include',
163       '<(SHARED_INTERMEDIATE_DIR)/blink',
164     ],
165     'xcode_settings': {
166       # Some Mac-specific parts of WebKit won't compile without having this
167       # prefix header injected.
168       # FIXME: make this a first-class setting.
169       'GCC_PREFIX_HEADER': '../core/WebCorePrefixMac.h',
170     },
171     'sources': [
172       '<@(platform_files)',
173
174       # Additional .cpp files from platform_generated.gyp:make_platform_generated actions.
175       '<(SHARED_INTERMEDIATE_DIR)/blink/FontFamilyNames.cpp',
176       '<(SHARED_INTERMEDIATE_DIR)/blink/RuntimeEnabledFeatures.cpp',
177       '<(SHARED_INTERMEDIATE_DIR)/blink/RuntimeEnabledFeatures.h',
178       '<(SHARED_INTERMEDIATE_DIR)/blink/ColorData.cpp',
179     ],
180     'sources/': [
181       # Exclude all platform specific things, reinclude them below on a per-platform basis
182       # FIXME: Figure out how to store these patterns in a variable.
183       ['exclude', '(cf|cg|harfbuzz|mac|opentype|win)/'],
184       ['exclude', '(?<!Chromium)(CF|CG|Mac|Win)\\.(cpp|mm?)$'],
185
186       # *NEON.cpp files need special compile options.
187       # They are moved to the webcore_0_neon target.
188       ['exclude', 'graphics/cpu/arm/.*NEON\\.(cpp|h)'],
189       ['exclude', 'graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
190     ],
191     # Disable c4267 warnings until we fix size_t to int truncations.
192     # Disable c4724 warnings which is generated in VS2012 due to improper
193     # compiler optimizations, see crbug.com/237063
194     'msvs_disabled_warnings': [ 4267, 4334, 4724 ],
195     'conditions': [
196       ['OS=="linux" or OS=="android"', {
197         'sources/': [
198           # Cherry-pick files excluded by the broader regular expressions above.
199           ['include', 'fonts/harfbuzz/FontHarfBuzz\\.cpp$'],
200           ['include', 'fonts/harfbuzz/FontPlatformDataHarfBuzz\\.cpp$'],
201           ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
202           ['include', 'fonts/harfbuzz/HarfBuzzFaceSkia\\.cpp$'],
203           ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
204           ['include', 'fonts/opentype/OpenTypeTypes\\.h$'],
205           ['include', 'fonts/opentype/OpenTypeVerticalData\\.(cpp|h)$'],
206           ['include', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
207         ],
208         'dependencies': [
209           '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
210         ],
211       }, { # OS!="linux" and OS!="android"
212         'sources/': [
213           ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'],
214         ],
215       }],
216       ['OS=="mac"', {
217         'dependencies': [
218           '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
219         ],
220         'link_settings': {
221           'libraries': [
222             '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
223             '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
224             '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
225           ]
226         },
227         'sources/': [
228           # We use LocaleMac.mm instead of LocaleICU.cpp
229           ['exclude', 'text/LocaleICU\\.(cpp|h)$'],
230           ['include', 'text/LocaleMac\\.mm$'],
231
232           # The Mac uses mac/KillRingMac.mm instead of the dummy
233           # implementation.
234           ['exclude', 'KillRingNone\\.cpp$'],
235
236           # The Mac build is USE(CF).
237           ['include', 'CF\\.cpp$'],
238
239           # Use native Mac font code from core.
240           ['include', '(fonts/)?mac/[^/]*Font[^/]*\\.(cpp|mm?)$'],
241           ['include', 'fonts/mac/ComplexText[^/]*\\.(cpp|h)$'],
242
243           # Cherry-pick some files that can't be included by broader regexps.
244           # Some of these are used instead of Chromium platform files, see
245           # the specific exclusions in the "exclude" list below.
246           ['include', 'audio/mac/FFTFrameMac\\.cpp$'],
247           ['include', 'fonts/mac/GlyphPageTreeNodeMac\\.cpp$'],
248           ['include', 'fonts/mac/ComplexTextControllerCoreText\\.mm$'],
249           ['include', 'mac/ColorMac\\.mm$'],
250           ['include', 'mac/BlockExceptions\\.mm$'],
251           ['include', 'mac/KillRingMac\\.mm$'],
252           ['include', 'mac/LocalCurrentGraphicsContext\\.mm$'],
253           ['include', 'mac/NSScrollerImpDetails\\.mm$'],
254           ['include', 'mac/ScrollAnimatorMac\\.mm$'],
255           ['include', 'mac/ScrollElasticityController\\.mm$'],
256           ['include', 'mac/ThemeMac\\.h$'],
257           ['include', 'mac/ThemeMac\\.mm$'],
258  
259           # Mac uses only ScrollAnimatorMac.
260           ['exclude', 'scroll/ScrollbarThemeNonMacCommon\\.(cpp|h)$'],
261           ['exclude', 'scroll/ScrollAnimatorNone\\.cpp$'],
262           ['exclude', 'scroll/ScrollAnimatorNone\\.h$'],
263
264           # The Mac currently uses FontCustomPlatformDataMac.cpp,
265           # included by regex above, instead.
266           ['exclude', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
267
268           ['exclude', 'fonts/skia/FontCacheSkia\\.cpp$'],
269           ['exclude', 'fonts/skia/GlyphPageTreeNodeSkia\\.cpp$'],
270           ['exclude', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
271
272           # Mac uses Harfbuzz.
273           ['include', 'fonts/harfbuzz/HarfBuzzFaceCoreText\\.cpp$'],
274           ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
275           ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
276
277           ['include', 'geometry/mac/FloatPointMac\\.mm$'],
278           ['include', 'geometry/mac/FloatRectMac\\.mm$'],
279           ['include', 'geometry/mac/FloatSizeMac\\.mm$'],
280           ['include', 'geometry/mac/IntPointMac\\.mm$'],
281           ['include', 'geometry/mac/IntRectMac\\.mm$'],
282
283           ['include', 'geometry/cg/FloatPointCG\\.cpp$'],
284           ['include', 'geometry/cg/FloatRectCG\\.cpp$'],
285           ['include', 'geometry/cg/FloatSizeCG\\.cpp$'],
286           ['include', 'geometry/cg/IntPointCG\\.cpp$'],
287           ['include', 'geometry/cg/IntRectCG\\.cpp$'],
288           ['include', 'geometry/cg/IntSizeCG\\.cpp$'],
289         ],
290         'defines': [
291         'WebFontCache=ChromiumWebCoreObjCWebFontCache',
292         ],
293       }, { # OS!="mac"
294         'sources/': [
295           ['exclude', 'mac/'],
296           ['exclude', 'geometry/mac/'],
297           ['exclude', 'geometry/cg/'],
298           ['exclude', 'scroll/ScrollbarThemeMac'],
299
300           # FIXME: We will eventually compile this too, but for now it's
301           # only used on mac.
302           ['exclude', 'fonts/FontPlatformData\\.cpp$'],
303           ['exclude', 'fonts/harfbuzz/HarfBuzzFaceCoreText\\.cpp$'],
304         ],
305       }],
306       ['OS != "linux" and OS != "mac" and (OS != "win" or (OS == "win" and "ENABLE_GDI_FONTS_ON_WINDOWS=1" in feature_defines))', {
307         'sources/': [
308           ['exclude', 'VDMX[^/]+\\.(cpp|h)$'],
309         ],
310       }],
311       ['OS=="win"', {
312         'sources/': [
313           # We use LocaleWin.cpp instead of LocaleICU.cpp
314           ['exclude', 'text/LocaleICU\\.(cpp|h)$'],
315           ['include', 'text/LocaleWin\\.(cpp|h)$'],
316
317           ['include', 'clipboard/ClipboardUtilitiesWin\\.(cpp|h)$'],
318
319           ['include', 'fonts/win/FontFallbackWin\\.(cpp|h)$'],
320           ['include', 'fonts/win/FontPlatformDataWin\\.(cpp|h)$'],
321           ['include', 'fonts/win/FontWin\\.cpp$'],
322           ['include', 'fonts/opentype/'],
323           ['include', 'fonts/skia/SkiaFontWin\\.(cpp|h)$'],
324           ['include', 'fonts/win/UniscribeHelper\\.(cpp|h)$'],
325           ['include', 'fonts/win/UniscribeHelperTextRun\\.(cpp|h)$'],
326
327           # SystemInfo.cpp is useful and we don't want to copy it.
328           ['include', 'win/SystemInfo\\.cpp$'],
329         ],
330         'conditions': [
331           ['"ENABLE_GDI_FONTS_ON_WINDOWS=1" in feature_defines', {
332             'sources/': [
333               ['include', 'fonts/win/FontCustomPlatformDataWin\\.cpp$'],
334               ['exclude', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
335               ['exclude', 'fonts/skia/GlyphPageTreeNodeSkia\\.cpp$'],
336               ['exclude', 'fonts/skia/FontCacheSkia\\.cpp$'],
337               ['exclude', 'fonts/skia/FontCacheSkiaWin\\.cpp$'],
338               ['exclude', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
339             ],
340           },{ # ENABLE_GDI_FONTS_ON_WINDOWS!=1
341             'sources/': [
342               ['include', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
343               ['include', 'fonts/skia/GlyphPageTreeNodeSkia\\.cpp$'],
344               ['include', 'fonts/skia/FontCacheSkiaWin\\.cpp$'],
345               ['include', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
346               ['include', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
347               ['exclude', 'fonts/win/FontCustomPlatformDataWin\\.cpp$'],
348               ['exclude', 'fonts/win/SimpleFontDataWin\\.cpp$'],
349               ['exclude', 'fonts/GlyphPageTreeNodeWin\\.cpp$'],
350               ['exclude', 'fonts/FontCacheWin\\.cpp$'],
351             ],
352           }],
353           ['"ENABLE_HARFBUZZ_ON_WINDOWS=1" in feature_defines', {
354             'sources/': [
355               ['include', 'fonts/harfbuzz/FontHarfBuzz\\.cpp$'],
356               ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
357               ['include', 'fonts/harfbuzz/HarfBuzzFaceSkia\\.cpp$'],
358               ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
359               ['exclude', 'fonts/win/FontWin\\.cpp$'],
360               ['exclude', '/(Uniscribe)[^/]*\\.(cpp|h)$'],
361             ],
362             'dependencies': [
363               '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
364             ],
365           }],
366         ],
367       }, { # OS!="win"
368         'sources/': [
369           ['exclude', 'win/'],
370           ['exclude', 'Win\\.cpp$'],
371           ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$'],
372           ['include', 'fonts/opentype/OpenTypeSanitizer\\.cpp$'],
373         ],
374       }],
375       ['OS=="win" and chromium_win_pch==1', {
376         'sources/': [
377           ['include', '<(DEPTH)/third_party/WebKit/Source/build/win/Precompile.cpp'],
378         ],
379       }],
380       ['OS=="android"', {
381         'sources/': [
382           ['include', '^fonts/VDMXParser\\.cpp$'],
383         ],
384       }, { # OS!="android"
385         'sources/': [
386           ['exclude', 'Android\\.cpp$'],
387         ],
388       }],
389       ['OS=="linux"', {
390         'dependencies': [
391           '<(DEPTH)/build/linux/system.gyp:fontconfig',
392         ],
393         'export_dependent_settings': [
394           '<(DEPTH)/build/linux/system.gyp:fontconfig',
395         ],
396       }],
397       ['use_default_render_theme==0', {
398         'sources/': [
399           ['exclude', 'scroll/ScrollbarThemeGtkOrAura\\.(cpp|h)'],
400         ],
401       }],
402       ['"WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', {
403         'include_dirs': [
404           '<(DEPTH)/third_party/ffmpeg',
405         ],
406         'dependencies': [
407           '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
408         ],
409       }],
410       ['"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1" in feature_defines', {
411          'include_dirs': [
412            '<(DEPTH)/third_party/openmax_dl',
413          ],
414         'dependencies': [
415           '<(DEPTH)/third_party/openmax_dl/dl/dl.gyp:openmax_dl',
416         ],
417       }],
418       ['target_arch=="arm"', {
419         'dependencies': [
420           'blink_arm_neon',
421         ],
422       }],
423     ],
424     'target_conditions': [
425       ['OS=="android"', {
426         'sources/': [
427             ['include', 'exported/linux/WebFontRenderStyle\\.cpp$'],
428         ],
429       }],
430     ],
431   },
432   # The *NEON.cpp files fail to compile when -mthumb is passed. Force
433   # them to build in ARM mode.
434   # See https://bugs.webkit.org/show_bug.cgi?id=62916.
435   {
436     'target_name': 'blink_arm_neon',
437     'conditions': [
438       ['target_arch=="arm"', {
439         'type': 'static_library',
440         'dependencies': [
441           'blink_common',
442         ],
443         'hard_dependency': 1,
444         'sources': [
445           '<@(platform_files)',
446         ],
447         'sources/': [
448           ['exclude', '.*'],
449           ['include', 'graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
450         ],
451         'cflags': ['-marm'],
452         'conditions': [
453           ['OS=="android"', {
454             'cflags!': ['-mthumb'],
455           }],
456         ],
457       },{  # target_arch!="arm"
458         'type': 'none',
459       }],
460     ],
461   }],
462 }