Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / platform / blink_platform.gyp
blob3060e80318b408e03c17cc2610a57f313bbab767
2 # Copyright (C) 2013 Google Inc. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
6 # met:
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.
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.
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             'WebScrollAnimationHelperDelegate=ChromiumWebCoreObjCWebScrollAnimationHelperDelegate',
147             'WebScrollbarPainterControllerDelegate=ChromiumWebCoreObjCWebScrollbarPainterControllerDelegate',
148             'WebScrollbarPainterDelegate=ChromiumWebCoreObjCWebScrollbarPainterDelegate',
149             'WebScrollbarPartAnimation=ChromiumWebCoreObjCWebScrollbarPartAnimation',
150             'WebCoreFlippedView=ChromiumWebCoreObjCWebCoreFlippedView',
151             'WebCoreScrollbarObserver=ChromiumWebCoreObjCWebCoreScrollbarObserver',
152             'WebCoreTextFieldCell=ChromiumWebCoreObjCWebCoreTextFieldCell',
153           ],
154           'postbuilds': [
155             {
156               # This step ensures that any Objective-C names that aren't
157               # redefined to be "safe" above will cause a build failure.
158               'postbuild_name': 'Check Objective-C Rename',
159               'variables': {
160                 'class_whitelist_regex':
161                     'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView|ScrollerStyleObserver|LayoutThemeNotificationObserver',
162                 'category_whitelist_regex':
163                     'WebCoreFocusRingDrawing|WebCoreTheme',
164               },
165               'action': [
166                 '../build/scripts/check_objc_rename.sh',
167                 '<(class_whitelist_regex)',
168                 '<(category_whitelist_regex)',
169               ],
170             },
171           ],
172         },
173       }],
174     ],
175   },
176   {
177     'target_name': 'blink_platform',
178     'type': '<(component)',
179     'dependencies': [
180       '../config.gyp:config',
181       '../wtf/wtf.gyp:wtf',
182       'blink_common',
183       'blink_heap_asm_stubs',
184       'blink_prerequisites',
185       '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
186       '<(DEPTH)/skia/skia.gyp:skia',
187       '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
188       '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
189       '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
190       '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
191       '<(DEPTH)/third_party/ots/ots.gyp:ots',
192       '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
193       '<(DEPTH)/url/url.gyp:url_lib',
194       '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
195       'platform_generated.gyp:make_platform_generated',
196       '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
197       '<(libjpeg_gyp_path):libjpeg',
198     ],
199     'export_dependent_settings': [
200       '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
201       '<(DEPTH)/skia/skia.gyp:skia',
202       '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
203       '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
204       '<(DEPTH)/third_party/ots/ots.gyp:ots',
205       '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
206       '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
207       '<(DEPTH)/url/url.gyp:url_lib',
208       '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
209       '<(libjpeg_gyp_path):libjpeg',
210     ],
211     'defines': [
212       'BLINK_PLATFORM_IMPLEMENTATION=1',
213       'INSIDE_BLINK',
214     ],
215     'include_dirs': [
216       '<(angle_path)/include',
217       '<(SHARED_INTERMEDIATE_DIR)/blink',
218     ],
219     'xcode_settings': {
220       # Some Mac-specific parts of WebKit won't compile without having this
221       # prefix header injected.
222       'GCC_PREFIX_HEADER': '<(DEPTH)/third_party/WebKit/Source/build/mac/Prefix.h',
223     },
224     'sources': [
225       '<@(platform_files)',
226       '<@(platform_heap_files)',
228       # Additional .cpp files from platform_generated.gyp:make_platform_generated actions.
229       '<(blink_platform_output_dir)/FontFamilyNames.cpp',
230       '<(blink_platform_output_dir)/RuntimeEnabledFeatures.cpp',
231       '<(blink_platform_output_dir)/RuntimeEnabledFeatures.h',
232       '<(blink_platform_output_dir)/ColorData.cpp',
233     ],
234     'sources/': [
235       # Exclude all platform specific things, reinclude them below on a per-platform basis
236       # FIXME: Figure out how to store these patterns in a variable.
237       ['exclude', '(cf|cg|mac|opentype|win)/'],
238       ['exclude', '(?<!Chromium)(CF|CG|Mac|Win)\\.(cpp|mm?)$'],
240       # *NEON.cpp files need special compile options.
241       # They are moved to the webcore_0_neon target.
242       ['exclude', 'graphics/cpu/arm/.*NEON\\.(cpp|h)'],
243       ['exclude', 'graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
244     ],
245     # Disable c4267 warnings until we fix size_t to int truncations.
246     # Disable c4724 warnings which is generated in VS2012 due to improper
247     # compiler optimizations, see crbug.com/237063
248     'msvs_disabled_warnings': [ 4267, 4334, 4724 ],
249     'conditions': [
250       ['target_arch == "ia32" or target_arch == "x64"', {
251         'sources/': [
252           ['include', 'graphics/cpu/x86/WebGLImageConversionSSE\\.h$'],
253         ],
254       }],
255       ['OS=="linux" or OS=="android" or OS=="win"', {
256         'sources/': [
257           # Cherry-pick files excluded by the broader regular expressions above.
258           ['include', 'fonts/opentype/OpenTypeTypes\\.h$'],
259           ['include', 'fonts/opentype/OpenTypeVerticalData\\.(cpp|h)$'],
260         ],
261         'dependencies': [
262           '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
263         ],
264       },
265       ],
266       ['OS=="linux" or OS=="android"', {
267         'sources/': [
268           ['include', 'fonts/linux/FontPlatformDataLinux\\.cpp$'],
269         ]
270       }, { # OS!="linux" and OS!="android"
271         'sources/': [
272           ['exclude', 'fonts/linux/FontPlatformDataLinux\\.cpp$'],
273         ]
274       }],
275       ['OS=="mac"', {
276         'dependencies': [
277           '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
278         ],
279         'link_settings': {
280           'libraries': [
281             '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
282             '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
283             '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
284           ]
285         },
286         'sources/': [
287           # We use LocaleMac.mm instead of LocaleICU.cpp
288           ['exclude', 'text/LocaleICU\\.(cpp|h)$'],
289           ['include', 'text/LocaleMac\\.mm$'],
291           # The Mac uses mac/KillRingMac.mm instead of the dummy
292           # implementation.
293           ['exclude', 'KillRingNone\\.cpp$'],
295           # The Mac build is USE(CF).
296           ['include', 'CF\\.cpp$'],
298           # Use native Mac font code from core.
299           ['include', '(fonts/)?mac/[^/]*Font[^/]*\\.(cpp|mm?)$'],
301           # TODO(dro): Merge the opentype vertical data files inclusion across all platforms.
302           ['include', 'fonts/opentype/OpenTypeTypes\\.h$'],
303           ['include', 'fonts/opentype/OpenTypeVerticalData\\.(cpp|h)$'],
305           # Cherry-pick some files that can't be included by broader regexps.
306           # Some of these are used instead of Chromium platform files, see
307           # the specific exclusions in the "exclude" list below.
308           ['include', 'audio/mac/FFTFrameMac\\.cpp$'],
309           ['include', 'fonts/mac/GlyphPageTreeNodeMac\\.cpp$'],
310           ['include', 'mac/ColorMac\\.mm$'],
311           ['include', 'mac/BlockExceptions\\.mm$'],
312           ['include', 'mac/KillRingMac\\.mm$'],
313           ['include', 'mac/LocalCurrentGraphicsContext\\.mm$'],
314           ['include', 'mac/NSScrollerImpDetails\\.mm$'],
315           ['include', 'mac/ScrollAnimatorMac\\.mm$'],
316           ['include', 'mac/ThemeMac\\.h$'],
317           ['include', 'mac/ThemeMac\\.mm$'],
318           ['include', 'mac/VersionUtilMac\\.h$'],
319           ['include', 'mac/VersionUtilMac\\.mm$'],
320           ['include', 'mac/WebCoreNSCellExtras\\.h$'],
321           ['include', 'mac/WebCoreNSCellExtras\\.mm$'],
323           # Mac uses only ScrollAnimatorMac.
324           ['exclude', 'scroll/ScrollbarThemeNonMacCommon\\.(cpp|h)$'],
325           ['exclude', 'scroll/ScrollAnimatorNone\\.cpp$'],
326           ['exclude', 'scroll/ScrollAnimatorNone\\.h$'],
328           ['exclude', 'fonts/skia/FontCacheSkia\\.cpp$'],
330           ['include', 'geometry/mac/FloatPointMac\\.mm$'],
331           ['include', 'geometry/mac/FloatRectMac\\.mm$'],
332           ['include', 'geometry/mac/FloatSizeMac\\.mm$'],
333           ['include', 'geometry/mac/IntPointMac\\.mm$'],
334           ['include', 'geometry/mac/IntRectMac\\.mm$'],
336           ['include', 'geometry/cg/FloatPointCG\\.cpp$'],
337           ['include', 'geometry/cg/FloatRectCG\\.cpp$'],
338           ['include', 'geometry/cg/FloatSizeCG\\.cpp$'],
339           ['include', 'geometry/cg/IntPointCG\\.cpp$'],
340           ['include', 'geometry/cg/IntRectCG\\.cpp$'],
341           ['include', 'geometry/cg/IntSizeCG\\.cpp$'],
342         ],
343       }, { # OS!="mac"
344         'sources/': [
345           ['exclude', 'mac/'],
346           ['exclude', 'geometry/mac/'],
347           ['exclude', 'geometry/cg/'],
348           ['exclude', 'scroll/ScrollbarThemeMac'],
349         ],
350       }],
351       ['OS != "linux" and OS != "mac" and OS != "win"', {
352         'sources/': [
353           ['exclude', 'VDMX[^/]+\\.(cpp|h)$'],
354         ],
355       }],
356       ['OS=="win"', {
357         'sources/': [
358           # We use LocaleWin.cpp instead of LocaleICU.cpp
359           ['exclude', 'text/LocaleICU\\.(cpp|h)$'],
360           ['include', 'text/LocaleWin\\.(cpp|h)$'],
362           ['include', 'clipboard/ClipboardUtilitiesWin\\.(cpp|h)$'],
364           ['include', 'fonts/opentype/'],
365           ['include', 'fonts/win/FontCacheSkiaWin\\.cpp$'],
366           ['include', 'fonts/win/FontFallbackWin\\.(cpp|h)$'],
367           ['include', 'fonts/win/FontPlatformDataWin\\.cpp$'],
369           # SystemInfo.cpp is useful and we don't want to copy it.
370           ['include', 'win/SystemInfo\\.cpp$'],
371         ],
372       }, { # OS!="win"
373         'sources/': [
374           ['exclude', 'win/'],
375           ['exclude', 'Win\\.cpp$'],
376           ['exclude', '/(Windows)[^/]*\\.cpp$'],
377           ['include', 'fonts/opentype/OpenTypeSanitizer\\.cpp$'],
378         ],
379       }],
380       ['OS=="win" and chromium_win_pch==1', {
381         'sources/': [
382           ['include', '<(DEPTH)/third_party/WebKit/Source/build/win/Precompile.cpp'],
383         ],
384       }],
385       ['OS=="android"', {
386         'sources/': [
387           ['include', '^fonts/VDMXParser\\.cpp$'],
388         ],
389       }, { # OS!="android"
390         'sources/': [
391           ['exclude', 'Android\\.cpp$'],
392         ],
393       }],
394       ['OS=="linux"', {
395         'dependencies': [
396           '<(DEPTH)/build/linux/system.gyp:fontconfig',
397         ],
398         'export_dependent_settings': [
399           '<(DEPTH)/build/linux/system.gyp:fontconfig',
400         ],
401       }],
402       ['use_default_render_theme==0', {
403         'sources/': [
404           ['exclude', 'scroll/ScrollbarThemeAura\\.(cpp|h)'],
405         ],
406       }],
407       ['"WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', {
408         'include_dirs': [
409           '<(DEPTH)/third_party/ffmpeg',
410         ],
411         'dependencies': [
412           '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
413         ],
414       }],
415       ['"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1" in feature_defines', {
416          'include_dirs': [
417            '<(DEPTH)/third_party/openmax_dl',
418          ],
419         'dependencies': [
420           '<(DEPTH)/third_party/openmax_dl/dl/dl.gyp:openmax_dl',
421         ],
422       }],
423       ['target_arch=="arm"', {
424         'dependencies': [
425           'blink_arm_neon',
426         ],
427       }],
428     ],
429     'target_conditions': [
430       ['OS=="android"', {
431         'sources/': [
432             ['include', 'exported/linux/WebFontRenderStyle\\.cpp$'],
433             ['include', 'fonts/linux/FontPlatformDataLinux\\.cpp$'],
434         ],
435       }],
436     ],
437   },
438   # The *NEON.cpp files fail to compile when -mthumb is passed. Force
439   # them to build in ARM mode.
440   # See https://bugs.webkit.org/show_bug.cgi?id=62916.
441   {
442     'target_name': 'blink_arm_neon',
443     'conditions': [
444       ['target_arch=="arm"', {
445         'type': 'static_library',
446         'dependencies': [
447           'blink_common',
448         ],
449         'hard_dependency': 1,
450         'sources': [
451           '<@(platform_files)',
452         ],
453         'sources/': [
454           ['exclude', '.*'],
455           ['include', 'graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
456         ],
457         'cflags': ['-marm'],
458         'conditions': [
459           ['OS=="android"', {
460             'cflags!': ['-mthumb'],
461           }],
462         ],
463       },{  # target_arch!="arm"
464         'type': 'none',
465       }],
466     ],
467   }],