Upstream version 9.38.198.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     'heap/blink_heap.gypi',
37   ],
38   'targets': [{
39     'target_name': 'blink_common',
40     'type': '<(component)',
41     'variables': { 'enable_wexit_time_destructors': 1 },
42     'dependencies': [
43       '../config.gyp:config',
44       '../wtf/wtf.gyp:wtf',
45       # FIXME: Can we remove the dependency on Skia?
46       '<(DEPTH)/skia/skia.gyp:skia',
47     ],
48     'all_dependent_settings': {
49       'include_dirs': [
50         '..',
51       ],
52     },
53     'export_dependent_settings': [
54       '<(DEPTH)/skia/skia.gyp:skia',
55     ],
56     'defines': [
57       'BLINK_COMMON_IMPLEMENTATION=1',
58       'INSIDE_BLINK',
59     ],
60     'include_dirs': [
61       '<(SHARED_INTERMEDIATE_DIR)/blink',
62     ],
63     'sources': [
64       'exported/WebCString.cpp',
65       'exported/WebString.cpp',
66       'exported/WebCommon.cpp',
67     ],
68   },
69   {
70     'target_name': 'blink_heap_asm_stubs',
71     'type': 'static_library',
72     # VS2010 does not correctly incrementally link obj files generated
73     # from asm files. This flag disables UseLibraryDependencyInputs to
74     # avoid this problem.
75     'msvs_2010_disable_uldi_when_referenced': 1,
76     'includes': [
77       '../../../yasm/yasm_compile.gypi',
78     ],
79     'sources': [
80       '<@(platform_heap_asm_files)',
81     ],
82     'variables': {
83       'more_yasm_flags': [],
84       'conditions': [
85         ['OS == "mac"', {
86           'more_yasm_flags': [
87             # Necessary to ensure symbols end up with a _ prefix; added by
88             # yasm_compile.gypi for Windows, but not Mac.
89             '-DPREFIX',
90           ],
91         }],
92         ['OS == "win" and target_arch == "x64"', {
93           'more_yasm_flags': [
94             '-DX64WIN=1',
95           ],
96         }],
97         ['OS != "win" and target_arch == "x64"', {
98           'more_yasm_flags': [
99             '-DX64POSIX=1',
100           ],
101         }],
102         ['target_arch == "ia32"', {
103           'more_yasm_flags': [
104             '-DIA32=1',
105           ],
106         }],
107         ['target_arch == "arm"', {
108           'more_yasm_flags': [
109             '-DARM=1',
110           ],
111         }],
112       ],
113       'yasm_flags': [
114         '>@(more_yasm_flags)',
115       ],
116       'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/webcore/heap'
117     },
118   },
119   {
120     'target_name': 'blink_prerequisites',
121     'type': 'none',
122     'conditions': [
123       ['OS=="mac"', {
124         'direct_dependent_settings': {
125           'defines': [
126             # Chromium's version of WebCore includes the following Objective-C
127             # classes. The system-provided WebCore framework may also provide
128             # these classes. Because of the nature of Objective-C binding
129             # (dynamically at runtime), it's possible for the
130             # Chromium-provided versions to interfere with the system-provided
131             # versions.  This may happen when a system framework attempts to
132             # use core.framework, such as when converting an HTML-flavored
133             # string to an NSAttributedString.  The solution is to force
134             # Objective-C class names that would conflict to use alternate
135             # names.
136             #
137             # This list will hopefully shrink but may also grow.  Its
138             # performance is monitored by the "Check Objective-C Rename"
139             # postbuild step, and any suspicious-looking symbols not handled
140             # here or whitelisted in that step will cause a build failure.
141             #
142             # If this is unhandled, the console will receive log messages
143             # such as:
144             # 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.
145             'WebCascadeList=ChromiumWebCoreObjCWebCascadeList',
146             'WebFontCache=ChromiumWebCoreObjCWebFontCache',
147             'WebScrollAnimationHelperDelegate=ChromiumWebCoreObjCWebScrollAnimationHelperDelegate',
148             'WebScrollbarPainterControllerDelegate=ChromiumWebCoreObjCWebScrollbarPainterControllerDelegate',
149             'WebScrollbarPainterDelegate=ChromiumWebCoreObjCWebScrollbarPainterDelegate',
150             'WebScrollbarPartAnimation=ChromiumWebCoreObjCWebScrollbarPartAnimation',
151             'WebCoreFlippedView=ChromiumWebCoreObjCWebCoreFlippedView',
152             'WebCoreTextFieldCell=ChromiumWebCoreObjCWebCoreTextFieldCell',
153             'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver',
154           ],
155           'postbuilds': [
156             {
157               # This step ensures that any Objective-C names that aren't
158               # redefined to be "safe" above will cause a build failure.
159               'postbuild_name': 'Check Objective-C Rename',
160               'variables': {
161                 'class_whitelist_regex':
162                     'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView|ScrollerStyleObserver',
163                 'category_whitelist_regex':
164                     'WebCoreFocusRingDrawing|WebCoreTheme',
165               },
166               'action': [
167                 '../build/scripts/check_objc_rename.sh',
168                 '<(class_whitelist_regex)',
169                 '<(category_whitelist_regex)',
170               ],
171             },
172           ],
173         },
174       }],
175     ],
176   },
177   {
178     'target_name': 'blink_platform',
179     'type': '<(component)',
180     'dependencies': [
181       '../config.gyp:config',
182       '../wtf/wtf.gyp:wtf',
183       'blink_common',
184       'blink_heap_asm_stubs',
185       'blink_prerequisites',
186       '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
187       '<(DEPTH)/skia/skia.gyp:skia',
188       '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
189       '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
190       '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
191       '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
192       '<(DEPTH)/third_party/ots/ots.gyp:ots',
193       '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
194       '<(DEPTH)/url/url.gyp:url_lib',
195       '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
196       'platform_generated.gyp:make_platform_generated',
197       '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
198       '<(libjpeg_gyp_path):libjpeg',
199     ],
200     'export_dependent_settings': [
201       '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
202       '<(DEPTH)/skia/skia.gyp:skia',
203       '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
204       '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
205       '<(DEPTH)/third_party/ots/ots.gyp:ots',
206       '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
207       '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
208       '<(DEPTH)/url/url.gyp:url_lib',
209       '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
210       '<(libjpeg_gyp_path):libjpeg',
211     ],
212     'defines': [
213       'BLINK_PLATFORM_IMPLEMENTATION=1',
214       'INSIDE_BLINK',
215     ],
216     'include_dirs': [
217       '<(angle_path)/include',
218       '<(SHARED_INTERMEDIATE_DIR)/blink',
219     ],
220     'xcode_settings': {
221       # Some Mac-specific parts of WebKit won't compile without having this
222       # prefix header injected.
223       'GCC_PREFIX_HEADER': '<(DEPTH)/third_party/WebKit/Source/build/mac/Prefix.h',
224     },
225     'sources': [
226       '<@(platform_files)',
227       '<@(platform_heap_files)',
228
229       # Additional .cpp files from platform_generated.gyp:make_platform_generated actions.
230       '<(blink_platform_output_dir)/FontFamilyNames.cpp',
231       '<(blink_platform_output_dir)/RuntimeEnabledFeatures.cpp',
232       '<(blink_platform_output_dir)/RuntimeEnabledFeatures.h',
233       '<(blink_platform_output_dir)/ColorData.cpp',
234     ],
235     'sources/': [
236       # Exclude all platform specific things, reinclude them below on a per-platform basis
237       # FIXME: Figure out how to store these patterns in a variable.
238       ['exclude', '(cf|cg|harfbuzz|mac|opentype|win)/'],
239       ['exclude', '(?<!Chromium)(CF|CG|Mac|Win)\\.(cpp|mm?)$'],
240
241       # *NEON.cpp files need special compile options.
242       # They are moved to the webcore_0_neon target.
243       ['exclude', 'graphics/cpu/arm/.*NEON\\.(cpp|h)'],
244       ['exclude', 'graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
245     ],
246     # Disable c4267 warnings until we fix size_t to int truncations.
247     # Disable c4724 warnings which is generated in VS2012 due to improper
248     # compiler optimizations, see crbug.com/237063
249     'msvs_disabled_warnings': [ 4267, 4334, 4724 ],
250     'conditions': [
251       ['OS=="linux" or OS=="android" or OS=="win"', {
252         'sources/': [
253           # Cherry-pick files excluded by the broader regular expressions above.
254           ['include', 'fonts/harfbuzz/FontHarfBuzz\\.cpp$'],
255           ['include', 'fonts/harfbuzz/FontPlatformDataHarfBuzz\\.cpp$'],
256           ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
257           ['include', 'fonts/harfbuzz/HarfBuzzFaceSkia\\.cpp$'],
258           ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
259           ['include', 'fonts/opentype/OpenTypeTypes\\.h$'],
260           ['include', 'fonts/opentype/OpenTypeVerticalData\\.(cpp|h)$'],
261           ['include', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
262         ],
263         'dependencies': [
264           '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
265         ],
266       }, { # OS!="linux" and OS!="android" and OS!="win"
267         'sources/': [
268           ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'],
269         ],
270       }],
271       ['OS=="linux" or OS=="android"', {
272         'sources/': [
273           ['include', 'fonts/linux/FontPlatformDataLinux\\.cpp$'],
274         ]
275       }, { # OS!="linux" and OS!="android"
276         'sources/': [
277           ['exclude', 'fonts/linux/FontPlatformDataLinux\\.cpp$'],
278         ]
279       }],
280       ['OS=="mac"', {
281         'dependencies': [
282           '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
283         ],
284         'link_settings': {
285           'libraries': [
286             '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
287             '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
288             '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
289           ]
290         },
291         'sources/': [
292           # We use LocaleMac.mm instead of LocaleICU.cpp
293           ['exclude', 'text/LocaleICU\\.(cpp|h)$'],
294           ['include', 'text/LocaleMac\\.mm$'],
295
296           # The Mac uses mac/KillRingMac.mm instead of the dummy
297           # implementation.
298           ['exclude', 'KillRingNone\\.cpp$'],
299
300           # The Mac build is USE(CF).
301           ['include', 'CF\\.cpp$'],
302
303           # Use native Mac font code from core.
304           ['include', '(fonts/)?mac/[^/]*Font[^/]*\\.(cpp|mm?)$'],
305           ['include', 'fonts/mac/ComplexText[^/]*\\.(cpp|h)$'],
306
307           # Cherry-pick some files that can't be included by broader regexps.
308           # Some of these are used instead of Chromium platform files, see
309           # the specific exclusions in the "exclude" list below.
310           ['include', 'audio/mac/FFTFrameMac\\.cpp$'],
311           ['include', 'fonts/mac/ComplexTextControllerCoreText\\.mm$'],
312           ['include', 'mac/ColorMac\\.mm$'],
313           ['include', 'mac/BlockExceptions\\.mm$'],
314           ['include', 'mac/KillRingMac\\.mm$'],
315           ['include', 'mac/LocalCurrentGraphicsContext\\.mm$'],
316           ['include', 'mac/NSScrollerImpDetails\\.mm$'],
317           ['include', 'mac/ScrollAnimatorMac\\.mm$'],
318           ['include', 'mac/ScrollElasticityController\\.mm$'],
319           ['include', 'mac/ThemeMac\\.h$'],
320           ['include', 'mac/ThemeMac\\.mm$'],
321           ['include', 'mac/WebCoreNSCellExtras\\.h$'],
322           ['include', 'mac/WebCoreNSCellExtras\\.mm$'],
323  
324           # Mac uses only ScrollAnimatorMac.
325           ['exclude', 'scroll/ScrollbarThemeNonMacCommon\\.(cpp|h)$'],
326           ['exclude', 'scroll/ScrollAnimatorNone\\.cpp$'],
327           ['exclude', 'scroll/ScrollAnimatorNone\\.h$'],
328
329           # The Mac currently uses FontCustomPlatformDataMac.cpp,
330           # included by regex above, instead.
331           ['exclude', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
332
333           ['exclude', 'fonts/skia/FontCacheSkia\\.cpp$'],
334           ['exclude', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
335
336           # Mac uses Harfbuzz.
337           ['include', 'fonts/harfbuzz/HarfBuzzFaceCoreText\\.cpp$'],
338           ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
339           ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
340
341           ['include', 'geometry/mac/FloatPointMac\\.mm$'],
342           ['include', 'geometry/mac/FloatRectMac\\.mm$'],
343           ['include', 'geometry/mac/FloatSizeMac\\.mm$'],
344           ['include', 'geometry/mac/IntPointMac\\.mm$'],
345           ['include', 'geometry/mac/IntRectMac\\.mm$'],
346
347           ['include', 'geometry/cg/FloatPointCG\\.cpp$'],
348           ['include', 'geometry/cg/FloatRectCG\\.cpp$'],
349           ['include', 'geometry/cg/FloatSizeCG\\.cpp$'],
350           ['include', 'geometry/cg/IntPointCG\\.cpp$'],
351           ['include', 'geometry/cg/IntRectCG\\.cpp$'],
352           ['include', 'geometry/cg/IntSizeCG\\.cpp$'],
353         ],
354         'defines': [
355         'WebFontCache=ChromiumWebCoreObjCWebFontCache',
356         ],
357       }, { # OS!="mac"
358         'sources/': [
359           ['exclude', 'mac/'],
360           ['exclude', 'geometry/mac/'],
361           ['exclude', 'geometry/cg/'],
362           ['exclude', 'scroll/ScrollbarThemeMac'],
363
364           # FIXME: We will eventually compile this too, but for now it's
365           # only used on mac.
366           ['exclude', 'fonts/FontPlatformData\\.cpp$'],
367           ['exclude', 'fonts/harfbuzz/HarfBuzzFaceCoreText\\.cpp$'],
368         ],
369       }],
370       ['OS != "linux" and OS != "mac" and OS != "win"', {
371         'sources/': [
372           ['exclude', 'VDMX[^/]+\\.(cpp|h)$'],
373         ],
374       }],
375       ['OS=="win"', {
376         'sources/': [
377           # We use LocaleWin.cpp instead of LocaleICU.cpp
378           ['exclude', 'text/LocaleICU\\.(cpp|h)$'],
379           ['include', 'text/LocaleWin\\.(cpp|h)$'],
380
381           ['include', 'clipboard/ClipboardUtilitiesWin\\.(cpp|h)$'],
382
383           ['include', 'fonts/opentype/'],
384           ['include', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
385           ['include', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
386           ['include', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
387           ['include', 'fonts/win/FontCacheSkiaWin\\.cpp$'],
388           ['include', 'fonts/win/FontFallbackWin\\.(cpp|h)$'],
389           ['include', 'fonts/win/FontPlatformDataWin\\.cpp$'],
390
391           # SystemInfo.cpp is useful and we don't want to copy it.
392           ['include', 'win/SystemInfo\\.cpp$'],
393         ],
394       }, { # OS!="win"
395         'sources/': [
396           ['exclude', 'win/'],
397           ['exclude', 'Win\\.cpp$'],
398           ['exclude', '/(Windows)[^/]*\\.cpp$'],
399           ['include', 'fonts/opentype/OpenTypeSanitizer\\.cpp$'],
400         ],
401       }],
402       ['OS=="win" and chromium_win_pch==1', {
403         'sources/': [
404           ['include', '<(DEPTH)/third_party/WebKit/Source/build/win/Precompile.cpp'],
405         ],
406       }],
407       ['OS=="android"', {
408         'sources/': [
409           ['include', '^fonts/VDMXParser\\.cpp$'],
410         ],
411       }, { # OS!="android"
412         'sources/': [
413           ['exclude', 'Android\\.cpp$'],
414         ],
415       }],
416       ['OS=="linux"', {
417         'dependencies': [
418           '<(DEPTH)/build/linux/system.gyp:fontconfig',
419         ],
420         'export_dependent_settings': [
421           '<(DEPTH)/build/linux/system.gyp:fontconfig',
422         ],
423       }],
424       ['use_default_render_theme==0', {
425         'sources/': [
426           ['exclude', 'scroll/ScrollbarThemeAura\\.(cpp|h)'],
427         ],
428       }],
429       ['"WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', {
430         'include_dirs': [
431           '<(DEPTH)/third_party/ffmpeg',
432         ],
433         'dependencies': [
434           '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
435         ],
436       }],
437       ['"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1" in feature_defines', {
438          'include_dirs': [
439            '<(DEPTH)/third_party/openmax_dl',
440          ],
441         'dependencies': [
442           '<(DEPTH)/third_party/openmax_dl/dl/dl.gyp:openmax_dl',
443         ],
444       }],
445       ['target_arch=="arm"', {
446         'dependencies': [
447           'blink_arm_neon',
448         ],
449       }],
450     ],
451     'target_conditions': [
452       ['OS=="android"', {
453         'sources/': [
454             ['include', 'exported/linux/WebFontRenderStyle\\.cpp$'],
455             ['include', 'fonts/linux/FontPlatformDataLinux\\.cpp$'],
456         ],
457       }],
458     ],
459   },
460   # The *NEON.cpp files fail to compile when -mthumb is passed. Force
461   # them to build in ARM mode.
462   # See https://bugs.webkit.org/show_bug.cgi?id=62916.
463   {
464     'target_name': 'blink_arm_neon',
465     'conditions': [
466       ['target_arch=="arm"', {
467         'type': 'static_library',
468         'dependencies': [
469           'blink_common',
470         ],
471         'hard_dependency': 1,
472         'sources': [
473           '<@(platform_files)',
474         ],
475         'sources/': [
476           ['exclude', '.*'],
477           ['include', 'graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
478         ],
479         'cflags': ['-marm'],
480         'conditions': [
481           ['OS=="android"', {
482             'cflags!': ['-mthumb'],
483           }],
484         ],
485       },{  # target_arch!="arm"
486         'type': 'none',
487       }],
488     ],
489   }],
490 }