Unreviewed, rolling out r97954.
[WebKit-https.git] / Source / WebCore / WebCore.gyp / WebCore.gyp
1 #
2 # Copyright (C) 2009 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 {
32   'includes': [
33     # FIXME: Sense whether upstream or downstream build, and
34     # include the right features.gypi
35     '../../WebKit/chromium/features.gypi',
36     '../WebCore.gypi',
37   ],
38   # Location of the chromium src directory.
39   'conditions': [
40     ['inside_chromium_build==0', {
41       # Webkit is being built outside of the full chromium project.
42       'variables': {
43         'chromium_src_dir': '../../WebKit/chromium',
44         'libjpeg_gyp_path': '<(chromium_src_dir)/third_party/libjpeg_turbo/libjpeg.gyp',
45       },
46     },{
47       # WebKit is checked out in src/chromium/third_party/WebKit
48       'variables': {
49         'chromium_src_dir': '../../../../..',
50       },
51     }],
52     ['OS == "mac"', {
53       'targets': [
54         {
55           # On the Mac, libWebKitSystemInterface*.a is used to help WebCore
56           # interface with the system.  This library is supplied as a static
57           # library in binary format.  At present, it contains many global
58           # symbols not marked private_extern.  It should be considered an
59           # implementation detail of WebCore, and does not need these symbols
60           # to be exposed so widely.
61           #
62           # This target contains an action that cracks open the existing
63           # static library and rebuilds it with these global symbols
64           # transformed to private_extern.
65           'target_name': 'webkit_system_interface',
66           'type': 'static_library',
67           'variables': {
68             'adjusted_library_path':
69                 '<(PRODUCT_DIR)/libWebKitSystemInterfaceLeopardPrivateExtern.a',
70           },
71           'sources': [
72             # An empty source file is needed to convince Xcode to produce
73             # output for this target.  The resulting library won't actually
74             # contain anything.  The library at adjusted_library_path will,
75             # and that library is pushed to dependents of this target below.
76             'mac/Empty.cpp',
77           ],
78           'actions': [
79             {
80               'action_name': 'Adjust Visibility',
81               'inputs': [
82                 'mac/adjust_visibility.sh',
83                 '../../../WebKitLibraries/libWebKitSystemInterfaceLeopard.a',
84               ],
85               'outputs': [
86                 '<(adjusted_library_path)',
87               ],
88               'action': [
89                 '<@(_inputs)',
90                 '<@(_outputs)',
91                 '<(INTERMEDIATE_DIR)/adjust_visibility',  # work directory
92               ],
93             },
94           ],  # actions
95           'link_settings': {
96             'libraries': [
97               '<(adjusted_library_path)',
98             ],
99           },  # link_settings
100         },  # target webkit_system_interface
101       ],  # targets
102     }],  # condition OS == "mac"
103     ['OS!="win" and remove_webcore_debug_symbols==1', {
104       # Remove -g from all targets defined here.
105       'target_defaults': {
106         'cflags!': ['-g'],
107       },
108     }],
109     ['os_posix==1 and OS!="mac" and OS!="android" and gcc_version==46', {
110       'target_defaults': {
111         # Disable warnings about c++0x compatibility, as some names (such as nullptr) conflict
112         # with upcoming c++0x types.
113         'cflags_cc': ['-Wno-c++0x-compat'],
114       },
115     }],
116     ['OS=="linux" and target_arch=="arm"', {
117       # Due to a bug in gcc arm, we get warnings about uninitialized timesNewRoman.unstatic.3258
118       # and colorTransparent.unstatic.4879.
119       'target_defaults': {
120         'cflags': ['-Wno-uninitialized'],
121       },
122     }],
123   ],  # conditions
124
125   'variables': {
126     # If set to 1, doesn't compile debug symbols into webcore reducing the
127     # size of the binary and increasing the speed of gdb.  gcc only.
128     'remove_webcore_debug_symbols%': 0,
129
130     # If set to 0, doesn't build SVG support, reducing the size of the
131     # binary and increasing the speed of gdb.
132     'enable_svg%': 1,
133
134     'webcore_include_dirs': [
135       '../',
136       '../..',
137       '../accessibility',
138       '../accessibility/chromium',
139       '../bindings',
140       '../bindings/generic',
141       '../bindings/v8',
142       '../bindings/v8/custom',
143       '../bindings/v8/specialization',
144       '../bridge',
145       '../bridge/jni',
146       '../bridge/jni/v8',
147       '../css',
148       '../dom',
149       '../dom/default',
150       '../editing',
151       '../fileapi',
152       '../history',
153       '../html',
154       '../html/canvas',
155       '../html/parser',
156       '../html/shadow',
157       '../html/track',
158       '../inspector',
159       '../loader',
160       '../loader/appcache',
161       '../loader/archive',
162       '../loader/archive/cf',
163       '../loader/archive/mhtml',
164       '../loader/cache',
165       '../loader/icon',
166       '../mathml',
167       '../notifications',
168       '../p2p',
169       '../page',
170       '../page/animation',
171       '../page/chromium',
172       '../platform',
173       '../platform/animation',
174       '../platform/audio',
175       '../platform/audio/chromium',
176       '../platform/chromium',
177       '../platform/graphics',
178       '../platform/graphics/chromium',
179       '../platform/graphics/filters',
180       '../platform/graphics/filters/arm',
181       '../platform/graphics/gpu',
182       '../platform/graphics/opentype',
183       '../platform/graphics/skia',
184       '../platform/graphics/transforms',
185       '../platform/image-decoders',
186       '../platform/image-decoders/bmp',
187       '../platform/image-decoders/gif',
188       '../platform/image-decoders/ico',
189       '../platform/image-decoders/jpeg',
190       '../platform/image-decoders/png',
191       '../platform/image-decoders/skia',
192       '../platform/image-decoders/xbm',
193       '../platform/image-decoders/webp',
194       '../platform/image-encoders/skia',
195       '../platform/leveldb',
196       '../platform/mediastream',
197       '../platform/mock',
198       '../platform/network',
199       '../platform/network/chromium',
200       '../platform/sql',
201       '../platform/text',
202       '../platform/text/transcoder',
203       '../plugins',
204       '../plugins/chromium',
205       '../rendering',
206       '../rendering/style',
207       '../rendering/svg',
208       '../storage',
209       '../storage/chromium',
210       '../svg',
211       '../svg/animation',
212       '../svg/graphics',
213       '../svg/graphics/filters',
214       '../svg/properties',
215       '../../ThirdParty/glu',
216       '../webaudio',
217       '../websockets',
218       '../workers',
219       '../xml',
220       '../xml/parser',
221     ],
222
223     'bindings_idl_files': [
224       '<@(webcore_bindings_idl_files)',
225     ],
226
227     'bindings_idl_files!': [
228       # Custom bindings in bindings/v8/custom exist for these.
229       '../dom/EventListener.idl',
230       '../dom/EventTarget.idl',
231       '../html/VoidCallback.idl',
232
233       # Bindings with custom Objective-C implementations.
234       '../page/AbstractView.idl',
235
236       # These bindings are excluded, as they're only used through inheritance and don't define constants that would need a constructor.
237       '../svg/ElementTimeControl.idl',
238       '../svg/SVGExternalResourcesRequired.idl',
239       '../svg/SVGFilterPrimitiveStandardAttributes.idl',
240       '../svg/SVGFitToViewBox.idl',
241
242       '../svg/SVGLangSpace.idl',
243       '../svg/SVGLocatable.idl',
244       '../svg/SVGStylable.idl',
245       '../svg/SVGTests.idl',
246       '../svg/SVGTransformable.idl',
247       '../svg/SVGViewSpec.idl',
248       '../svg/SVGZoomAndPan.idl',
249
250       # FIXME: I don't know why these are excluded, either.
251       # Someone (me?) should figure it out and add appropriate comments.
252       '../css/CSSUnknownRule.idl',
253     ],
254
255     'conditions': [
256       # TODO(maruel): Move it in its own project or generate it anyway?
257       ['enable_svg!=0', {
258         'bindings_idl_files': [
259           '<@(webcore_svg_bindings_idl_files)',
260         ],
261       }],
262       ['OS=="mac" and use_skia==0', {
263         'webcore_include_dirs+': [
264           # platform/graphics/cg and cocoa need to come before
265           # platform/graphics/chromium so that the Mac build picks up the
266           # version of ImageBufferData.h in the cg directory and
267           # FontPlatformData.h in the cocoa directory.  The + prepends this
268           # directory to the list.
269           # FIXME: This shouldn't need to be prepended.
270           '../platform/graphics/cocoa',
271           '../platform/graphics/cg',
272         ],
273       }],
274       ['OS=="mac"', {
275         'webcore_include_dirs': [
276           # FIXME: Eliminate dependency on platform/mac and related
277           # directories.
278           # FIXME: Eliminate dependency on platform/graphics/mac and
279           # related directories.
280           # platform/graphics/cg may need to stick around, though.
281           '../platform/audio/mac',
282           '../platform/cocoa',
283           '../platform/graphics/mac',
284           '../platform/mac',
285           '../platform/text/mac',
286         ],
287       }],
288       ['OS=="mac" and use_skia==1', {
289         'webcore_include_dirs': [
290               '../platform/graphics/cocoa',
291               '../platform/graphics/cg',
292         ],
293       }],
294       ['OS=="win"', {
295         'webcore_include_dirs': [
296           '../page/win',
297           '../platform/audio/win',
298           '../platform/graphics/win',
299           '../platform/text/win',
300           '../platform/win',
301         ],
302       },{
303         # enable -Wall and -Werror, just for Mac and Linux builds for now
304         # FIXME: Also enable this for Windows after verifying no warnings
305         'chromium_code': 1,
306       }],
307       ['OS=="win" and buildtype=="Official"', {
308         # On windows official release builds, we try to preserve symbol space.
309         'derived_sources_aggregate_files': [
310           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSourcesAll.cpp',
311         ],
312       },{
313         'derived_sources_aggregate_files': [
314           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources01.cpp',
315           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources02.cpp',
316           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources03.cpp',
317           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources04.cpp',
318           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources05.cpp',
319           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources06.cpp',
320           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources07.cpp',
321           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources08.cpp',
322           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources09.cpp',
323           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources10.cpp',
324           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources11.cpp',
325           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources12.cpp',
326           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources13.cpp',
327           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources14.cpp',
328           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources15.cpp',
329           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources16.cpp',
330           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources17.cpp',
331           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources18.cpp',
332           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources19.cpp',
333         ],
334       }],
335     ],
336   },
337   'targets': [
338     {
339       'target_name': 'generate_inspector_protocol_version',
340       'type': 'none',
341       'actions': [
342          {
343           'action_name': 'generateInspectorProtocolVersion',
344           'inputs': [
345             '../inspector/generate-inspector-protocol-version',
346             '../inspector/Inspector.json',
347           ],
348           'outputs': [
349             '<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorProtocolVersion.h',
350           ],
351           'variables': {
352             'generator_include_dirs': [
353             ],
354           },
355           'action': [
356             'python',
357             '../inspector/generate-inspector-protocol-version',
358             '-o',
359             '<@(_outputs)',
360             '<@(_inputs)'
361           ],
362           'message': 'Validate inspector protocol for backwards compatibility and generate version file',
363         }
364       ]
365     },
366     {
367       'target_name': 'inspector_idl',
368       'type': 'none',
369       'actions': [
370
371         {
372           'action_name': 'generateInspectorProtocolIDL',
373           'inputs': [
374             '../inspector/generate-inspector-idl',
375             '../inspector/Inspector.json',
376           ],
377           'outputs': [
378             '<(SHARED_INTERMEDIATE_DIR)/webcore/Inspector.idl',
379           ],
380           'variables': {
381             'generator_include_dirs': [
382             ],
383           },
384           'action': [
385             'python',
386             '../inspector/generate-inspector-idl',
387             '-o',
388             '<@(_outputs)',
389             '<@(_inputs)'
390           ],
391           'message': 'Generating Inspector protocol sources from Inspector.idl',
392         }
393       ]
394     },
395     {
396       'target_name': 'inspector_protocol_sources',
397       'type': 'none',
398       'dependencies': [
399         'inspector_idl',
400         'generate_inspector_protocol_version'
401       ],
402       'actions': [
403         {
404           'action_name': 'generateInspectorProtocolSources',
405           # The second input item will be used as item name in vcproj.
406           # It is not possible to put Inspector.idl there because
407           # all idl files are marking as excluded by gyp generator.
408           'inputs': [
409             '../bindings/scripts/generate-bindings.pl',
410             '../inspector/CodeGeneratorInspector.pm',
411             '../bindings/scripts/CodeGenerator.pm',
412             '../bindings/scripts/IDLParser.pm',
413             '../bindings/scripts/IDLStructure.pm',
414             '<(SHARED_INTERMEDIATE_DIR)/webcore/Inspector.idl',
415           ],
416           'outputs': [
417             '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendDispatcher.cpp',
418             '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js',
419             '<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorBackendDispatcher.h',
420             '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorFrontend.cpp',
421             '<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorFrontend.h',
422           ],
423           'variables': {
424             'generator_include_dirs': [
425             ],
426           },
427           'action': [
428             'python',
429             'scripts/rule_binding.py',
430             '<(SHARED_INTERMEDIATE_DIR)/webcore/Inspector.idl',
431             '<(SHARED_INTERMEDIATE_DIR)/webcore',
432             '<(SHARED_INTERMEDIATE_DIR)/webkit',
433             '--',
434             '<@(_inputs)',
435             '--',
436             '--defines', '<(feature_defines) LANGUAGE_JAVASCRIPT',
437             '--generator', 'Inspector',
438             '<@(generator_include_dirs)'
439           ],
440           'message': 'Generating Inspector protocol sources from Inspector.idl',
441         },
442       ]
443     },
444     {
445       'target_name': 'injected_script_source',
446       'type': 'none',
447       'actions': [
448         {
449           'action_name': 'generateInjectedScriptSource',
450           'inputs': [
451             '../inspector/InjectedScriptSource.js',
452           ],
453           'outputs': [
454             '<(SHARED_INTERMEDIATE_DIR)/webkit/InjectedScriptSource.h',
455           ],
456           'action': [
457             'perl',
458             '../inspector/xxd.pl',
459             'InjectedScriptSource_js',
460             '<@(_inputs)',
461             '<@(_outputs)'
462           ],
463           'message': 'Generating InjectedScriptSource.h from InjectedScriptSource.js',
464         },
465       ]
466     },
467     {
468       'target_name': 'debugger_script_source',
469       'type': 'none',
470       'actions': [
471         {
472           'action_name': 'generateDebuggerScriptSource',
473           'inputs': [
474             '../bindings/v8/DebuggerScript.js',
475           ],
476           'outputs': [
477             '<(SHARED_INTERMEDIATE_DIR)/webkit/DebuggerScriptSource.h',
478           ],
479           'action': [
480             'perl',
481             '../inspector/xxd.pl',
482             'DebuggerScriptSource_js',
483             '<@(_inputs)',
484             '<@(_outputs)'
485           ],
486           'message': 'Generating DebuggerScriptSource.h from DebuggerScript.js',
487         },
488       ]
489     },
490     {
491       'target_name': 'webcore_bindings_sources',
492       'type': 'none',
493       'hard_dependency': 1,
494       'sources': [
495         # bison rule
496         '../css/CSSGrammar.y',
497         '../xml/XPathGrammar.y',
498
499         # gperf rule
500         '../platform/ColorData.gperf',
501
502         # idl rules
503         '<@(bindings_idl_files)',
504         '<@(webcore_test_support_idl_files)',
505       ],
506       'actions': [
507         # Actions to build derived sources.
508         {
509           'action_name': 'generateV8ArrayBufferViewCustomScript',
510           'inputs': [
511             '../bindings/v8/custom/V8ArrayBufferViewCustomScript.js',
512           ],
513           'outputs': [
514             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8ArrayBufferViewCustomScript.h',
515           ],
516           'action': [
517             'perl',
518             '../inspector/xxd.pl',
519             'V8ArrayBufferViewCustomScript_js',
520             '<@(_inputs)',
521             '<@(_outputs)'
522           ],
523           'message': 'Generating V8ArrayBufferViewCustomScript.h from V8ArrayBufferViewCustomScript.js',
524         },
525         {
526           'action_name': 'generateXMLViewerCSS',
527           'inputs': [
528             '../xml/XMLViewer.css',
529           ],
530           'outputs': [
531             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLViewerCSS.h',
532           ],
533           'action': [
534             'perl',
535             '../inspector/xxd.pl',
536             'XMLViewer_css',
537             '<@(_inputs)',
538             '<@(_outputs)'
539           ],
540         },
541         {
542           'action_name': 'generateXMLViewerJS',
543           'inputs': [
544             '../xml/XMLViewer.js',
545           ],
546           'outputs': [
547             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLViewerJS.h',
548           ],
549           'action': [
550             'perl',
551             '../inspector/xxd.pl',
552             'XMLViewer_js',
553             '<@(_inputs)',
554             '<@(_outputs)'
555           ],
556         },
557         {
558           'action_name': 'HTMLEntityTable',
559           'inputs': [
560             '../html/parser/HTMLEntityNames.in',
561           ],
562           'outputs': [
563             '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp'
564           ],
565           'action': [
566             'python',
567             '../html/parser/create-html-entity-table',
568             '-o',
569             '<@(_outputs)',
570             '<@(_inputs)'
571           ],
572         },
573         {
574           'action_name': 'CSSPropertyNames',
575           'inputs': [
576             '../css/makeprop.pl',
577             '../css/CSSPropertyNames.in',
578           ],
579           'outputs': [
580             '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
581             '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.h',
582           ],
583           'action': [
584             'python',
585             'scripts/action_csspropertynames.py',
586             '<@(_outputs)',
587             '--',
588             '--defines', '<(feature_defines)',
589             '--',
590             '<@(_inputs)',
591           ],
592           'conditions': [
593             # TODO(maruel): Move it in its own project or generate it anyway?
594             ['enable_svg!=0', {
595               'inputs': [
596                 '../css/SVGCSSPropertyNames.in',
597               ],
598             }],
599           ],
600         },
601         {
602           'action_name': 'CSSValueKeywords',
603           'inputs': [
604             '../css/makevalues.pl',
605             '../css/CSSValueKeywords.in',
606           ],
607           'outputs': [
608             '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
609             '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.h',
610           ],
611           'action': [
612             'python',
613             'scripts/action_cssvaluekeywords.py',
614             '<@(_outputs)',
615             '--',
616             '--defines', '<(feature_defines)',
617             '--',
618             '<@(_inputs)',
619           ],
620           'conditions': [
621             # TODO(maruel): Move it in its own project or generate it anyway?
622             ['enable_svg!=0', {
623               'inputs': [
624                 '../css/SVGCSSValueKeywords.in',
625               ],
626             }],
627           ],
628         },
629         {
630           'action_name': 'HTMLNames',
631           'inputs': [
632             '../dom/make_names.pl',
633             '../html/HTMLTagNames.in',
634             '../html/HTMLAttributeNames.in',
635           ],
636           'outputs': [
637             '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp',
638             '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.h',
639             '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp',
640             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.cpp',
641             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.h',
642           ],
643           'action': [
644             'python',
645             'scripts/action_makenames.py',
646             '<@(_outputs)',
647             '--',
648             '<@(_inputs)',
649             '--',
650             '--factory',
651             '--wrapperFactoryV8',
652             '--extraDefines', '<(feature_defines)'
653           ],
654         },
655         {
656           'action_name': 'WebKitFontFamilyNames',
657           'inputs': [
658             '../dom/make_names.pl',
659             '../css/WebKitFontFamilyNames.in',
660           ],
661           'outputs': [
662             '<(SHARED_INTERMEDIATE_DIR)/webkit/WebKitFontFamilyNames.cpp',
663             '<(SHARED_INTERMEDIATE_DIR)/webkit/WebKitFontFamilyNames.h',
664           ],
665           'action': [
666             'python',
667             'scripts/action_makenames.py',
668             '<@(_outputs)',
669             '--',
670             '<@(_inputs)',
671             '--',
672             '--fonts',
673           ],
674         },
675         {
676           'action_name': 'SVGNames',
677           'inputs': [
678             '../dom/make_names.pl',
679             '../svg/svgtags.in',
680             '../svg/svgattrs.in',
681           ],
682           'outputs': [
683             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
684             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.h',
685             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp',
686             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.h',
687             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.cpp',
688             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.h',
689           ],
690           'action': [
691             'python',
692             'scripts/action_makenames.py',
693             '<@(_outputs)',
694             '--',
695             '<@(_inputs)',
696             '--',
697             '--factory',
698             '--wrapperFactoryV8',
699             '--extraDefines', '<(feature_defines)'
700           ],
701         },
702         {
703           'action_name': 'EventFactory',
704           'inputs': [
705             '../dom/make_event_factory.pl',
706             '../dom/EventFactory.in',
707           ],
708           'outputs': [
709             '<(SHARED_INTERMEDIATE_DIR)/webkit/EventFactory.cpp',
710           ],
711           'action': [
712             'python',
713             'scripts/action_makenames.py',
714             '<@(_outputs)',
715             '--',
716             '<@(_inputs)',
717           ],
718         },
719         {
720           'action_name': 'MathMLNames',
721           'inputs': [
722             '../dom/make_names.pl',
723             '../mathml/mathtags.in',
724             '../mathml/mathattrs.in',
725           ],
726           'outputs': [
727             '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
728             '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.h',
729             '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.cpp',
730             '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.h',
731           ],
732           'action': [
733             'python',
734             'scripts/action_makenames.py',
735             '<@(_outputs)',
736             '--',
737             '<@(_inputs)',
738             '--',
739             '--factory',
740             '--extraDefines', '<(feature_defines)'
741           ],
742         },
743         {
744           'action_name': 'UserAgentStyleSheets',
745           'variables': {
746             'scripts': [
747               '../css/make-css-file-arrays.pl',
748               '../bindings/scripts/preprocessor.pm',
749             ],
750             # The .css files are in the same order as ../DerivedSources.make.
751             'stylesheets': [
752               '../css/html.css',
753               '../css/quirks.css',
754               '../css/view-source.css',
755               '../css/themeChromium.css', # Chromium only.
756               '../css/themeChromiumLinux.css', # Chromium only.
757               '../css/themeChromiumSkia.css',  # Chromium only.
758               '../css/themeWin.css',
759               '../css/themeWinQuirks.css',
760               '../css/svg.css',
761               '../css/mathml.css',
762               '../css/mediaControls.css',
763               '../css/mediaControlsChromium.css',
764               '../css/fullscreen.css',
765               # Skip fullscreenQuickTime.
766             ],
767           },
768           'inputs': [
769             '<@(scripts)',
770             '<@(stylesheets)'
771           ],
772           'outputs': [
773             '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheets.h',
774             '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheetsData.cpp',
775           ],
776           'action': [
777             'python',
778             'scripts/action_useragentstylesheets.py',
779             '<@(_outputs)',
780             '<@(stylesheets)',
781             '--',
782             '<@(scripts)',
783             '--',
784             '--defines', '<(feature_defines)',
785           ],
786         },
787         {
788           'action_name': 'XLinkNames',
789           'inputs': [
790             '../dom/make_names.pl',
791             '../svg/xlinkattrs.in',
792           ],
793           'outputs': [
794             '<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.cpp',
795             '<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.h',
796           ],
797           'action': [
798             'python',
799             'scripts/action_makenames.py',
800             '<@(_outputs)',
801             '--',
802             '<@(_inputs)',
803             '--',
804             '--extraDefines', '<(feature_defines)'
805           ],
806         },
807         {
808           'action_name': 'XMLNSNames',
809           'inputs': [
810             '../dom/make_names.pl',
811             '../xml/xmlnsattrs.in',
812           ],
813           'outputs': [
814             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.cpp',
815             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.h',
816           ],
817           'action': [
818             'python',
819             'scripts/action_makenames.py',
820             '<@(_outputs)',
821             '--',
822             '<@(_inputs)',
823             '--',
824             '--extraDefines', '<(feature_defines)'
825           ],
826         },
827         {
828           'action_name': 'XMLNames',
829           'inputs': [
830             '../dom/make_names.pl',
831             '../xml/xmlattrs.in',
832           ],
833           'outputs': [
834             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
835             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.h',
836           ],
837           'action': [
838             'python',
839             'scripts/action_makenames.py',
840             '<@(_outputs)',
841             '--',
842             '<@(_inputs)',
843             '--',
844             '--extraDefines', '<(feature_defines)'
845           ],
846         },
847         {
848           'action_name': 'tokenizer',
849           'inputs': [
850             '../css/maketokenizer',
851             '../css/tokenizer.flex',
852           ],
853           'outputs': [
854             '<(SHARED_INTERMEDIATE_DIR)/webkit/tokenizer.cpp',
855           ],
856           'action': [
857             'python',
858             'scripts/action_maketokenizer.py',
859             '<@(_outputs)',
860             '--',
861             '<@(_inputs)'
862           ],
863         },
864         {
865           'action_name': 'derived_sources_all_in_one',
866           'variables': {
867             # Write sources into a file, so that the action command line won't
868             # exceed OS limites.
869             'idls_list_temp_file': '<|(idls_list_temp_file.tmp <@(bindings_idl_files))',
870           },
871           'inputs': [
872             'scripts/action_derivedsourcesallinone.py',
873             '<(idls_list_temp_file)',
874             '<!@(cat <(idls_list_temp_file))',
875           ],
876           'outputs': [
877             '<@(derived_sources_aggregate_files)',
878           ],
879           'action': [
880             'python',
881             'scripts/action_derivedsourcesallinone.py',
882             '<(idls_list_temp_file)',
883             '--',
884             '<@(derived_sources_aggregate_files)',
885           ],
886         },
887       ],
888       'rules': [
889         # Rules to build derived sources.
890         {
891           'rule_name': 'bison',
892           'extension': 'y',
893           'outputs': [
894             '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).cpp',
895             '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).h'
896           ],
897           'action': [
898             'python',
899             'scripts/rule_bison.py',
900             '<(RULE_INPUT_PATH)',
901             '<(SHARED_INTERMEDIATE_DIR)/webkit'
902           ],
903         },
904         {
905           'rule_name': 'gperf',
906           'extension': 'gperf',
907           #
908           # gperf outputs are generated by WebCore/make-hash-tools.pl
909           #
910           'outputs': [
911             '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).cpp',
912           ],
913           'inputs': [
914             '../make-hash-tools.pl',
915           ],
916           'action': [
917             'perl',
918             '../make-hash-tools.pl',
919             '<(SHARED_INTERMEDIATE_DIR)/webkit',
920             '<(RULE_INPUT_PATH)',
921           ],
922         },
923         # Rule to build generated JavaScript (V8) bindings from .idl source.
924         {
925           'rule_name': 'binding',
926           'extension': 'idl',
927           'msvs_external_rule': 1,
928           'inputs': [
929             '../bindings/scripts/generate-bindings.pl',
930             '../bindings/scripts/CodeGenerator.pm',
931             '../bindings/scripts/CodeGeneratorV8.pm',
932             '../bindings/scripts/IDLParser.pm',
933             '../bindings/scripts/IDLStructure.pm',
934             '../bindings/scripts/preprocessor.pm',
935           ],
936           'outputs': [
937             # FIXME:  The .cpp file should be in webkit/bindings once
938             # we coax GYP into supporting it (see 'action' below).
939             '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8<(RULE_INPUT_ROOT).cpp',
940             '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8<(RULE_INPUT_ROOT).h',
941           ],
942           'variables': {
943             'generator_include_dirs': [
944               '--include', '../css',
945               '--include', '../dom',
946               '--include', '../fileapi',
947               '--include', '../html',
948               '--include', '../notifications',
949               '--include', '../page',
950               '--include', '../plugins',
951               '--include', '../storage',
952               '--include', '../svg',
953               '--include', '../testing',
954               '--include', '../webaudio',
955               '--include', '../websockets',
956               '--include', '../workers',
957               '--include', '../xml',
958             ],
959           },
960           # FIXME:  Note that we put the .cpp files in webcore/bindings
961           # but the .h files in webkit/bindings.  This is to work around
962           # the unfortunate fact that GYP strips duplicate arguments
963           # from lists.  When we have a better GYP way to suppress that
964           # behavior, change the output location.
965           'action': [
966             'python',
967             'scripts/rule_binding.py',
968             '<(RULE_INPUT_PATH)',
969             '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings',
970             '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
971             '--',
972             '<@(_inputs)',
973             '--',
974             '--defines', '<(feature_defines) LANGUAGE_JAVASCRIPT V8_BINDING',
975             '--generator', 'V8',
976             '<@(generator_include_dirs)'
977           ],
978           'message': 'Generating binding from <(RULE_INPUT_PATH)',
979         },
980       ],
981     },
982     {
983       'target_name': 'webcore_bindings',
984       'type': 'static_library',
985       'hard_dependency': 1,
986       'dependencies': [
987         'webcore_bindings_sources',
988         'inspector_protocol_sources',
989         'injected_script_source',
990         'debugger_script_source',
991         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:yarr',
992         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
993         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
994         '<(chromium_src_dir)/skia/skia.gyp:skia',
995         '<(chromium_src_dir)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
996         '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng',
997         '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml',
998         '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt',
999         '<(chromium_src_dir)/third_party/libwebp/libwebp.gyp:libwebp',
1000         '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
1001         '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
1002         '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
1003         '<(libjpeg_gyp_path):libjpeg',
1004       ],
1005       'include_dirs': [
1006         '<(INTERMEDIATE_DIR)',
1007         # FIXME:  Remove <(SHARED_INTERMEDIATE_DIR)/webcore when we
1008         # can entice gyp into letting us put both the .cpp and .h
1009         # files in the same output directory.
1010         '<(SHARED_INTERMEDIATE_DIR)/webcore',
1011         '<(SHARED_INTERMEDIATE_DIR)/webkit',
1012         '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
1013         '<@(webcore_include_dirs)',
1014       ],
1015       'direct_dependent_settings': {
1016         'include_dirs': [
1017           '<(SHARED_INTERMEDIATE_DIR)/webkit',
1018           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
1019         ],
1020       },
1021       'sources': [
1022         # These files include all the .cpp files generated from the .idl files
1023         # in webcore_files.
1024         '<@(derived_sources_aggregate_files)',
1025
1026         # Additional .cpp files for HashTools.h
1027         '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorData.cpp',
1028         '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
1029         '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
1030
1031         # Additional .cpp files from webcore_bindings_sources actions.
1032         '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp',
1033         '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp',
1034         '<(SHARED_INTERMEDIATE_DIR)/webkit/EventFactory.cpp',
1035         '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheetsData.cpp',
1036         '<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.cpp',
1037         '<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.cpp',
1038         '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.cpp',
1039         '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
1040         '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
1041         '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.cpp',
1042         '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
1043         '<(SHARED_INTERMEDIATE_DIR)/webkit/WebKitFontFamilyNames.cpp',
1044
1045         # Generated from HTMLEntityNames.in
1046         '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp',
1047
1048         # Additional .cpp files from the webcore_bindings_sources rules.
1049         '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSGrammar.cpp',
1050         '<(SHARED_INTERMEDIATE_DIR)/webkit/XPathGrammar.cpp',
1051
1052         # Additional .cpp files from the webcore_inspector_sources list.
1053         '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorFrontend.cpp',
1054         '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendDispatcher.cpp',
1055       ],
1056       'conditions': [
1057         ['inside_chromium_build==1 and OS=="win" and component=="shared_library"', {
1058           'defines': [
1059             'USING_V8_SHARED',
1060           ],
1061         }],
1062         # TODO(maruel): Move it in its own project or generate it anyway?
1063         ['enable_svg!=0', {
1064           'sources': [
1065             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp',
1066             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.cpp',
1067          ],
1068         }],
1069         ['OS=="mac"', {
1070           'include_dirs': [
1071             '../../../WebKitLibraries',
1072           ],
1073         }],
1074         ['OS=="win"', {
1075           'dependencies': [
1076             '<(chromium_src_dir)/build/win/system.gyp:cygwin'
1077           ],
1078           'defines': [
1079             'WEBCORE_NAVIGATOR_PLATFORM="Win32"',
1080             '__PRETTY_FUNCTION__=__FUNCTION__',
1081           ],
1082           # This is needed because Event.h in this directory is blocked
1083           # by a system header on windows.
1084           'include_dirs++': ['../dom'],
1085           'direct_dependent_settings': {
1086             'include_dirs+++': ['../dom'],
1087           },
1088         }],
1089         ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', {
1090           'include_dirs': [
1091             '<(chromium_src_dir)/third_party/fftw/api',
1092           ],
1093         }],
1094       ],
1095     },
1096     {
1097       # We'll soon split libwebcore in multiple smaller libraries.
1098       # webcore_prerequisites will be the 'base' target of every sub-target.
1099       'target_name': 'webcore_prerequisites',
1100       'type': 'none',
1101       'dependencies': [
1102         'debugger_script_source',
1103         'injected_script_source',
1104         'inspector_protocol_sources',
1105         'webcore_bindings_sources',
1106         '../../ThirdParty/glu/glu.gyp:libtess',
1107         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:yarr',
1108         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
1109         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
1110         '<(chromium_src_dir)/skia/skia.gyp:skia',
1111         '<(chromium_src_dir)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
1112         '<(chromium_src_dir)/third_party/libwebp/libwebp.gyp:libwebp',
1113         '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng',
1114         '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml',
1115         '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt',
1116         '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
1117         '<(chromium_src_dir)/third_party/ots/ots.gyp:ots',
1118         '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
1119         '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_common',
1120         '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
1121         '<(libjpeg_gyp_path):libjpeg',
1122       ],
1123       'export_dependent_settings': [
1124         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:yarr',
1125         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
1126         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
1127         '<(chromium_src_dir)/skia/skia.gyp:skia',
1128         '<(chromium_src_dir)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
1129         '<(chromium_src_dir)/third_party/libwebp/libwebp.gyp:libwebp',
1130         '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng',
1131         '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml',
1132         '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt',
1133         '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
1134         '<(chromium_src_dir)/third_party/ots/ots.gyp:ots',
1135         '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
1136         '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_common',
1137         '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
1138         '<(libjpeg_gyp_path):libjpeg',
1139       ],
1140       # This is needed for mac because of webkit_system_interface. It'd be nice
1141       # if this hard dependency could be split off the rest.
1142       'hard_dependency': 1,
1143       'direct_dependent_settings': {
1144         'defines': [
1145           'WEBCORE_NAVIGATOR_VENDOR="Google Inc."',
1146         ],
1147         'include_dirs': [
1148           '<(INTERMEDIATE_DIR)',
1149           '<@(webcore_include_dirs)',
1150           '<(chromium_src_dir)/gpu',
1151           '<(chromium_src_dir)/third_party/angle/include/GLSLANG',
1152           '<(SHARED_INTERMEDIATE_DIR)/webkit',
1153           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
1154         ],
1155         'mac_framework_dirs': [
1156           '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks',
1157         ],
1158         'msvs_disabled_warnings': [
1159           4138, 4244, 4291, 4305, 4344, 4355, 4521, 4099,
1160         ],
1161         'scons_line_length' : 1,
1162         'xcode_settings': {
1163           # Some Mac-specific parts of WebKit won't compile without having this
1164           # prefix header injected.
1165           # FIXME: make this a first-class setting.
1166           'GCC_PREFIX_HEADER': '../WebCorePrefix.h',
1167         },
1168       },
1169       'conditions': [
1170         ['inside_chromium_build==1 and OS=="win" and component=="shared_library"', {
1171           'direct_dependent_settings': {
1172             'defines': [
1173                'USING_V8_SHARED',
1174             ],
1175           },
1176         }],
1177         ['use_accelerated_compositing==1', {
1178           'dependencies': [
1179             '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
1180           ],
1181           'export_dependent_settings': [
1182             '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
1183           ],
1184         }],
1185         ['use_x11 == 1', {
1186           'dependencies': [
1187             '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
1188           ],
1189           'export_dependent_settings': [
1190             '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
1191           ],
1192           'direct_dependent_settings': {
1193             'cflags': [
1194               # WebCore does not work with strict aliasing enabled.
1195               # https://bugs.webkit.org/show_bug.cgi?id=25864
1196               '-fno-strict-aliasing',
1197             ],
1198           },
1199         }],
1200         ['toolkit_uses_gtk == 1', {
1201           'dependencies': [
1202             '<(chromium_src_dir)/build/linux/system.gyp:gtk',
1203           ],
1204           'export_dependent_settings': [
1205             '<(chromium_src_dir)/build/linux/system.gyp:gtk',
1206           ],
1207         }],
1208         ['OS=="linux"', {
1209           'direct_dependent_settings': {
1210             'defines': [
1211               # Mozilla on Linux effectively uses uname -sm, but when running
1212               # 32-bit x86 code on an x86_64 processor, it uses
1213               # "Linux i686 (x86_64)".  Matching that would require making a
1214               # run-time determination.
1215               'WEBCORE_NAVIGATOR_PLATFORM="Linux i686"',
1216             ],
1217           },
1218         }],
1219         ['OS=="mac"', {
1220           'dependencies': [
1221             'webkit_system_interface',
1222           ],
1223           'export_dependent_settings': [
1224             'webkit_system_interface',
1225           ],
1226           'direct_dependent_settings': {
1227             'defines': [
1228               # Match Safari and Mozilla on Mac x86.
1229               'WEBCORE_NAVIGATOR_PLATFORM="MacIntel"',
1230
1231               # Chromium's version of WebCore includes the following Objective-C
1232               # classes. The system-provided WebCore framework may also provide
1233               # these classes. Because of the nature of Objective-C binding
1234               # (dynamically at runtime), it's possible for the
1235               # Chromium-provided versions to interfere with the system-provided
1236               # versions.  This may happen when a system framework attempts to
1237               # use WebCore.framework, such as when converting an HTML-flavored
1238               # string to an NSAttributedString.  The solution is to force
1239               # Objective-C class names that would conflict to use alternate
1240               # names.
1241               #
1242               # This list will hopefully shrink but may also grow.  Its
1243               # performance is monitored by the "Check Objective-C Rename"
1244               # postbuild step, and any suspicious-looking symbols not handled
1245               # here or whitelisted in that step will cause a build failure.
1246               #
1247               # If this is unhandled, the console will receive log messages
1248               # such as:
1249               # 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.
1250               'WebCascadeList=ChromiumWebCoreObjCWebCascadeList',
1251               'ScrollbarPrefsObserver=ChromiumWebCoreObjCScrollbarPrefsObserver',
1252               'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver',
1253               'WebFontCache=ChromiumWebCoreObjCWebFontCache',
1254               'ScrollAnimationHelperDelegate=ChromiumWebCoreObjCScrollAnimationHelperDelegate',
1255               'ScrollbarPainterControllerDelegate=ChromiumWebCoreObjCScrollbarPainterControllerDelegate',
1256               'ScrollbarPainterDelegate=ChromiumWebCoreObjCScrollbarPainterDelegate',
1257               'ScrollbarPartAnimation=ChromiumWebCoreObjCScrollbarPartAnimation',
1258             ],
1259             'include_dirs': [
1260               '../../../WebKitLibraries',
1261             ],
1262             'postbuilds': [
1263               {
1264                 # This step ensures that any Objective-C names that aren't
1265                 # redefined to be "safe" above will cause a build failure.
1266                 'postbuild_name': 'Check Objective-C Rename',
1267                 'variables': {
1268                   'class_whitelist_regex':
1269                       'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView',
1270                   'category_whitelist_regex':
1271                       'TCMInterposing|ScrollAnimatorChromiumMacExt',
1272                 },
1273                 'action': [
1274                   'mac/check_objc_rename.sh',
1275                   '<(class_whitelist_regex)',
1276                   '<(category_whitelist_regex)',
1277                 ],
1278               },
1279             ],
1280           },
1281         }],
1282         ['OS=="win"', {
1283           'dependencies': [
1284             '<(chromium_src_dir)/build/win/system.gyp:cygwin'
1285           ],
1286           'export_dependent_settings': [
1287             '<(chromium_src_dir)/build/win/system.gyp:cygwin'
1288           ],
1289           'direct_dependent_settings': {
1290             'defines': [
1291               # Match Safari and Mozilla on Windows.
1292               'WEBCORE_NAVIGATOR_PLATFORM="Win32"',
1293               '__PRETTY_FUNCTION__=__FUNCTION__',
1294             ],
1295             # This is needed because Event.h in this directory is blocked
1296             # by a system header on windows.
1297             'include_dirs++': ['../dom'],
1298           },
1299         }],
1300         ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', {
1301           # This directory needs to be on the include path for multiple sub-targets of webcore.
1302           'direct_dependent_settings': {
1303             'include_dirs': [
1304               '<(chromium_src_dir)/third_party/fftw/api',
1305             ],
1306           },
1307         }],
1308         ['(OS=="mac" or OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', {
1309           # This directory needs to be on the include path for multiple sub-targets of webcore.
1310           'direct_dependent_settings': {
1311             'include_dirs': [
1312               '<(chromium_src_dir)/third_party/ffmpeg/patched-ffmpeg',
1313             ],
1314           },
1315           'dependencies': [
1316             '<(chromium_src_dir)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1317           ],
1318         }],
1319         # Windows shared builder needs extra help for linkage
1320         ['OS=="win" and "WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', {
1321           'export_dependent_settings': [
1322             '<(chromium_src_dir)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
1323           ],
1324         }],
1325         ['"WTF_USE_LEVELDB=1" in feature_defines', {
1326           'dependencies': [
1327             '<(chromium_src_dir)/third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
1328           ],
1329           'export_dependent_settings': [
1330             '<(chromium_src_dir)/third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
1331           ],
1332         }],
1333       ],
1334     },
1335     {
1336       'target_name': 'webcore_dom',
1337       'type': 'static_library',
1338       'dependencies': [
1339         'webcore_prerequisites',
1340       ],
1341       'sources': [
1342         '<@(webcore_dom_privateheader_files)',
1343         '<@(webcore_dom_files)',
1344       ],
1345       'sources!': [
1346         '../dom/default/PlatformMessagePortChannel.cpp',
1347         '../dom/default/PlatformMessagePortChannel.h',
1348       ],
1349       'sources/': [
1350         # FIXME: Figure out how to store these patterns in a variable.
1351         ['exclude', '(cairo|ca|cf|cg|curl|efl|freetype|gstreamer|gtk|linux|mac|opengl|openvg|opentype|pango|posix|qt|soup|svg|symbian|texmap|iphone|win|wince|wx)/'],
1352         ['exclude', '(?<!Chromium)(Cairo|CF|CG|Curl|Gtk|JSC|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|WinCE|Wx)\\.(cpp|mm?)$'],
1353
1354         ['exclude', 'AllInOne\\.cpp$'],
1355       ],
1356     },
1357     {
1358       'target_name': 'webcore_html',
1359       'type': 'static_library',
1360       'dependencies': [
1361         'webcore_prerequisites',
1362       ],
1363       'sources': [
1364         '<@(webcore_html_privateheader_files)',
1365         '<@(webcore_html_files)',
1366       ],
1367       'sources/': [
1368         ['exclude', 'AllInOne\\.cpp$'],
1369       ],
1370     },
1371     {
1372       'target_name': 'webcore_svg',
1373       'type': 'static_library',
1374       'dependencies': [
1375         'webcore_prerequisites',
1376       ],
1377       'sources': [
1378         '<@(webcore_svg_privateheader_files)',
1379         '<@(webcore_svg_files)',
1380       ],
1381       'sources/': [
1382         ['exclude', 'AllInOne\\.cpp$'],
1383       ],
1384     },
1385     {
1386       'target_name': 'webcore_platform',
1387       'type': 'static_library',
1388       'dependencies': [
1389         'webcore_prerequisites',
1390       ],
1391       # This is needed for mac because of webkit_system_interface. It'd be nice
1392       # if this hard dependency could be split off the rest.
1393       'hard_dependency': 1,
1394       'sources': [
1395         '<@(webcore_privateheader_files)',
1396         '<@(webcore_files)',
1397
1398         # For WebCoreSystemInterface, Mac-only.
1399         '../../WebKit/mac/WebCoreSupport/WebSystemInterface.mm',
1400       ],
1401       'sources/': [
1402         ['exclude', '.*'],
1403         ['include', 'platform/'],
1404
1405         # FIXME: Figure out how to store these patterns in a variable.
1406         ['exclude', '(cairo|ca|cf|cg|curl|efl|freetype|gstreamer|gtk|linux|mac|opengl|openvg|opentype|pango|posix|qt|soup|svg|symbian|texmap|iphone|win|wince|wx)/'],
1407         ['exclude', '(?<!Chromium)(Cairo|CF|CG|Curl|Gtk|JSC|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|WinCE|Wx)\\.(cpp|mm?)$'],
1408
1409         ['exclude', 'platform/LinkHash\\.cpp$'],
1410         ['exclude', 'platform/MIMETypeRegistry\\.cpp$'],
1411         ['exclude', 'platform/Theme\\.cpp$'],
1412         ['exclude', 'platform/graphics/ANGLEWebKitBridge\\.(cpp|h)$'],
1413         # *NEON.cpp files need special compile options.
1414         # They are moved to the webcore_arm_neon target.
1415         ['exclude', 'platform/graphics/filters/arm/.*NEON\\.(cpp|h)'],
1416         ['exclude', 'platform/image-encoders/JPEGImageEncoder\\.(cpp|h)$'],
1417         ['exclude', 'platform/image-encoders/PNGImageEncoder\\.(cpp|h)$'],
1418         ['exclude', 'platform/network/ResourceHandle\\.cpp$'],
1419         ['exclude', 'platform/sql/SQLiteFileSystem\\.cpp$'],
1420         ['exclude', 'platform/text/LocaleToScriptMappingDefault\\.cpp$'],
1421         ['exclude', 'platform/text/LocalizedNumberNone\\.cpp$'],
1422         ['exclude', 'platform/text/TextEncodingDetectorNone\\.cpp$'],
1423       ],
1424       'conditions': [
1425         ['use_x11 == 1', {
1426           'sources/': [
1427             # Cherry-pick files excluded by the broader regular expressions above.
1428             ['include', 'platform/graphics/chromium/ComplexTextControllerLinux\\.cpp$'],
1429             ['include', 'platform/graphics/chromium/FontCacheLinux\\.cpp$'],
1430             ['include', 'platform/graphics/chromium/FontLinux\\.cpp$'],
1431             ['include', 'platform/graphics/chromium/FontPlatformDataLinux\\.cpp$'],
1432             ['include', 'platform/graphics/chromium/SimpleFontDataLinux\\.cpp$'],
1433           ],
1434         }, { # use_x11==0
1435           'sources/': [
1436             ['exclude', 'Linux\\.cpp$'],
1437             ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'],
1438           ],
1439         }],
1440         ['toolkit_uses_gtk == 1', {
1441           'sources/': [
1442             # Cherry-pick files excluded by the broader regular expressions above.
1443             ['include', 'platform/chromium/KeyCodeConversionGtk\\.cpp$'],
1444           ],
1445         }, { # toolkit_uses_gtk==0
1446           'sources/': [
1447             ['exclude', 'Gtk\\.cpp$'],
1448           ],
1449         }],
1450         ['use_x11==1 or OS=="android"', {
1451           'dependencies': [
1452             '<(chromium_src_dir)/third_party/harfbuzz/harfbuzz.gyp:harfbuzz',
1453           ],
1454         }],
1455         ['OS!="win"', {
1456           'sources/': [
1457             ['include', 'platform/graphics/opentype/OpenTypeSanitizer\\.cpp$'],
1458           ],
1459         }],['OS=="mac" and use_skia==0', {
1460           'sources/': [
1461             # The Mac build is PLATFORM_CG too.  platform/graphics/cg is the
1462             # only place that CG files we want to build are located, and not
1463             # all of them even have a CG suffix, so just add them by a
1464             # regexp matching their directory.
1465             ['include', 'platform/graphics/cg/[^/]*(?<!Win)?\\.(cpp|mm?)$'],
1466           ],
1467         }],['OS=="mac"', {
1468           # Necessary for Mac .mm stuff.
1469           'include_dirs': [
1470             '../../../WebKitLibraries',
1471           ],
1472           'dependencies': [
1473             'webkit_system_interface',
1474           ],
1475           'actions': [
1476             {
1477               # Allow framework-style #include of
1478               # <WebCore/WebCoreSystemInterface.h>.
1479               'action_name': 'WebCoreSystemInterface.h',
1480               'inputs': [
1481                 '../platform/mac/WebCoreSystemInterface.h',
1482               ],
1483               'outputs': [
1484                 '<(INTERMEDIATE_DIR)/WebCore/WebCoreSystemInterface.h',
1485               ],
1486               'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
1487             },
1488           ],
1489           'sources/': [
1490             # Additional files from the WebCore Mac build that are presently
1491             # used in the WebCore Chromium Mac build too.
1492
1493             # The Mac build is USE(CF) but does not use CFNetwork.
1494             ['include', 'CF\\.cpp$'],
1495             ['exclude', 'network/cf/'],
1496
1497             # Use native Mac font code from WebCore.
1498             ['include', 'platform/(graphics/)?mac/[^/]*Font[^/]*\\.(cpp|mm?)$'],
1499             ['include', 'platform/graphics/mac/ComplexText[^/]*\\.(cpp|h)$'],
1500
1501             # We can use this for the fast Accelerate.framework FFT.
1502             ['include', 'platform/audio/mac/FFTFrameMac\\.cpp$'],
1503
1504             # Cherry-pick some files that can't be included by broader regexps.
1505             # Some of these are used instead of Chromium platform files, see
1506             # the specific exclusions in the "sources!" list below.
1507             ['include', 'rendering/RenderThemeMac\\.mm$'],
1508             ['include', 'platform/graphics/mac/ColorMac\\.mm$'],
1509             ['include', 'platform/graphics/mac/ComplexTextControllerCoreText\\.mm$'],
1510             ['include', 'platform/graphics/mac/FloatPointMac\\.mm$'],
1511             ['include', 'platform/graphics/mac/FloatRectMac\\.mm$'],
1512             ['include', 'platform/graphics/mac/FloatSizeMac\\.mm$'],
1513             ['include', 'platform/graphics/mac/GlyphPageTreeNodeMac\\.cpp$'],
1514             ['include', 'platform/graphics/mac/IntPointMac\\.mm$'],
1515             ['include', 'platform/graphics/mac/IntRectMac\\.mm$'],
1516             ['include', 'platform/mac/BlockExceptions\\.mm$'],
1517             ['include', 'platform/mac/KillRingMac\\.mm$'],
1518             ['include', 'platform/mac/LocalCurrentGraphicsContext\\.mm$'],
1519             ['include', 'platform/mac/PurgeableBufferMac\\.cpp$'],
1520             ['include', 'platform/mac/WebCoreSystemInterface\\.mm$'],
1521             ['include', 'platform/mac/WebCoreTextRenderer\\.mm$'],
1522             ['include', 'platform/text/mac/ShapeArabic\\.c$'],
1523             ['include', 'platform/text/mac/String(Impl)?Mac\\.mm$'],
1524             # Use USE_NEW_THEME on Mac.
1525             ['include', 'platform/Theme\\.cpp$'],
1526
1527             ['include', 'WebKit/mac/WebCoreSupport/WebSystemInterface\\.mm$'],
1528
1529             # The Mac uses platform/mac/KillRingMac.mm instead of the dummy
1530             # implementation.
1531             ['exclude', 'platform/KillRingNone\\.cpp$'],
1532
1533             # The Mac currently uses FontCustomPlatformData.cpp from
1534             # platform/graphics/mac, included by regex above, instead.
1535             ['exclude', 'platform/graphics/skia/FontCustomPlatformData\\.cpp$'],
1536
1537             # The Mac currently uses ScrollbarThemeChromiumMac.mm, which is not
1538             # related to ScrollbarThemeChromium.cpp.
1539             ['exclude', 'platform/chromium/ScrollbarThemeChromium\\.cpp$'],
1540
1541             # The Mac does not use ImageSourceCG.cpp from platform/graphics/cg
1542             # even though it is included by regex above.
1543             ['exclude', 'platform/graphics/cg/ImageSourceCG\\.cpp$'],
1544             ['exclude', 'platform/graphics/cg/PDFDocumentImage\\.cpp$'],
1545
1546             ['include', '/chrome/junk\\.txt$'],
1547           ],
1548         },{ # OS!="mac"
1549           'sources/': [
1550             # FIXME: We will eventually compile this too, but for now it's
1551             # only used on mac.
1552             ['exclude', 'platform/graphics/FontPlatformData\\.cpp$'],
1553           ],
1554         }],
1555         ['OS=="mac" and use_skia==0', {
1556           'sources/': [
1557             # Cherry-pick some files that can't be included by broader regexps.
1558             # Some of these are used instead of Chromium platform files, see
1559             # the specific exclusions in the "sources!" list below.
1560             ['include', 'platform/graphics/mac/GraphicsContextMac\\.mm$'],
1561
1562             # Chromium Mac does not use skia.
1563             ['exclude', 'platform/graphics/skia/[^/]*Skia\\.(cpp|h)$'],
1564
1565             # The Mac currently uses ImageChromiumMac.mm from
1566             # platform/graphics/chromium, included by regex above, instead.
1567             ['exclude', 'platform/graphics/chromium/ImageChromium\\.cpp$'],
1568
1569             # ImageDecoderSkia is not used on mac.  ImageDecoderCG is used instead.
1570             ['exclude', 'platform/image-decoders/skia/ImageDecoderSkia\\.cpp$'],
1571             ['include', 'platform/image-decoders/cg/ImageDecoderCG\\.cpp$'],
1572
1573             # Again, Skia is not used on Mac.
1574             ['exclude', 'platform/chromium/DragImageChromiumSkia\\.cpp$'],
1575           ],
1576         }],
1577         ['OS=="mac" and use_skia==1', {
1578           'sources/': [
1579             ['include', 'platform/graphics/cg/FloatPointCG\\.cpp$'],
1580             ['include', 'platform/graphics/cg/FloatRectCG\\.cpp$'],
1581             ['include', 'platform/graphics/cg/FloatSizeCG\\.cpp$'],
1582             ['include', 'platform/graphics/cg/IntPointCG\\.cpp$'],
1583             ['include', 'platform/graphics/cg/IntRectCG\\.cpp$'],
1584             ['include', 'platform/graphics/cg/IntSizeCG\\.cpp$'],
1585             ['exclude', 'platform/graphics/mac/FontMac\\.mm$'],
1586             ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$'],
1587             ['exclude', 'platform/chromium/DragImageChromiumMac\\.cpp$'],
1588           ],
1589         }],
1590         ['use_x11 == 0 and (OS!="mac" or use_skia==0)', {
1591           'sources/': [
1592             ['exclude', 'VDMX[^/]+\\.(cpp|h)$'],
1593           ],
1594         }],
1595         ['OS!="mac"', {
1596           'sources/': [
1597             ['exclude', 'Mac\\.(cpp|mm?)$'],
1598
1599             # Linux uses FontLinux; Windows uses FontWin. Additionally, FontSkia
1600             # is excluded by a rule above if WebKit uses CG instead of Skia.
1601             ['exclude', 'platform/graphics/skia/FontSkia\\.cpp$'],
1602           ],
1603         }],
1604         ['OS!="win"', {
1605           'sources/': [
1606             ['exclude', 'Win\\.cpp$'],
1607             ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$']
1608           ],
1609         }],
1610         ['OS=="win"', {
1611           'sources/': [
1612             ['exclude', 'Posix\\.cpp$'],
1613
1614             # The Chromium Win currently uses GlyphPageTreeNodeChromiumWin.cpp from
1615             # platform/graphics/chromium, included by regex above, instead.
1616             ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$'],
1617
1618             # SystemInfo.cpp is useful and we don't want to copy it.
1619             ['include', 'platform/win/SystemInfo\\.cpp$'],
1620           ],
1621         }],
1622       ],
1623     },
1624     # The *NEON.cpp files fail to compile when -mthumb is passed. Force
1625     # them to build in ARM mode.
1626     # See https://bugs.webkit.org/show_bug.cgi?id=62916.
1627     {
1628       'target_name': 'webcore_arm_neon',
1629       'type': 'static_library',
1630       'dependencies': [
1631         'webcore_prerequisites',
1632       ],
1633       'hard_dependency': 1,
1634       'sources': [
1635         '<@(webcore_files)',
1636       ],
1637       'sources/': [
1638         ['exclude', '.*'],
1639         ['include', 'platform/graphics/filters/arm/.*NEON\\.(cpp|h)'],
1640       ],
1641       'conditions': [
1642         ['OS=="android"', {
1643           'cflags!': ['-mthumb'],
1644           'cflags': ['-marm'],
1645         }],
1646         ['OS=="linux" and target_arch=="arm"', {
1647           'cflags': ['-marm'],
1648         }],
1649       ],
1650     },
1651     {
1652       'target_name': 'webcore_rendering',
1653       'type': 'static_library',
1654       'dependencies': [
1655         'webcore_prerequisites',
1656       ],
1657       'sources': [
1658         '<@(webcore_privateheader_files)',
1659         '<@(webcore_files)',
1660       ],
1661       'sources/': [
1662         ['exclude', '.*'],
1663         ['include', 'rendering/'],
1664
1665         # FIXME: Figure out how to store these patterns in a variable.
1666         ['exclude', '(cairo|ca|cf|cg|curl|efl|freetype|gstreamer|gtk|linux|mac|opengl|openvg|opentype|pango|posix|qt|soup|svg|symbian|texmap|iphone|win|wince|wx)/'],
1667         ['exclude', '(?<!Chromium)(Cairo|CF|CG|Curl|Gtk|JSC|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|WinCE|Wx)\\.(cpp|mm?)$'],
1668
1669         ['exclude', 'AllInOne\\.cpp$'],
1670       ],
1671       'conditions': [
1672         ['OS=="win"', {
1673           'sources/': [
1674             ['exclude', 'Posix\\.cpp$'],
1675           ],
1676         }],
1677         ['OS=="mac"', {
1678           'sources/': [
1679             # RenderThemeChromiumSkia is not used on mac since RenderThemeChromiumMac
1680             # does not reference the Skia code that is used by Windows and Linux.
1681             ['exclude', 'rendering/RenderThemeChromiumSkia\\.cpp$'],
1682           ],
1683         }],
1684         ['os_posix == 1 and OS != "mac" and OS != "android" and gcc_version == 42', {
1685           # Due to a bug in gcc 4.2.1 (the current version on hardy), we get
1686           # warnings about uninitialized this.
1687           'cflags': ['-Wno-uninitialized'],
1688         }],
1689         ['use_x11 == 0', {
1690           'sources/': [
1691             ['exclude', 'Linux\\.cpp$'],
1692           ],
1693         }],
1694         ['toolkit_uses_gtk == 0', {
1695           'sources/': [
1696             ['exclude', 'Gtk\\.cpp$'],
1697           ],
1698         }],
1699         ['OS!="mac"', {
1700           'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
1701         }],
1702         ['OS!="win"', {
1703           'sources/': [
1704             ['exclude', 'Win\\.cpp$'],
1705           ],
1706         }],
1707       ],
1708     },
1709     {
1710       'target_name': 'webcore_remaining',
1711       'type': 'static_library',
1712       'dependencies': [
1713         'webcore_prerequisites',
1714         '<(chromium_src_dir)/third_party/v8-i18n/build/all.gyp:v8-i18n',
1715       ],
1716       # This is needed for mac because of webkit_system_interface. It'd be nice
1717       # if this hard dependency could be split off the rest.
1718       'hard_dependency': 1,
1719       'sources': [
1720         '<@(webcore_privateheader_files)',
1721         '<@(webcore_files)',
1722       ],
1723       'sources/': [
1724         ['exclude', 'platform/'],
1725         ['exclude', 'rendering/'],
1726
1727         # Exclude most of bindings, except of the V8-related parts.
1728         ['exclude', 'bindings/[^/]+/'],
1729         ['include', 'bindings/generic/'],
1730         ['include', 'bindings/v8/'],
1731
1732         # Exclude most of bridge, except for the V8-related parts.
1733         ['exclude', 'bridge/'],
1734         ['include', 'bridge/jni/'],
1735         ['exclude', 'bridge/jni/[^/]+_jsobject\\.mm$'],
1736         ['exclude', 'bridge/jni/[^/]+_objc\\.mm$'],
1737         ['exclude', 'bridge/jni/jsc/'],
1738
1739         # FIXME: Figure out how to store these patterns in a variable.
1740         ['exclude', '(cairo|ca|cf|cg|curl|efl|freetype|gstreamer|gtk|linux|mac|opengl|openvg|opentype|pango|posix|qt|soup|svg|symbian|texmap|iphone|win|wince|wx)/'],
1741         ['exclude', '(?<!Chromium)(Cairo|CF|CG|Curl|Gtk|JSC|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|WinCE|Wx)\\.(cpp|mm?)$'],
1742
1743         ['exclude', 'AllInOne\\.cpp$'],
1744
1745         ['exclude', 'fileapi/LocalFileSystem\\.cpp$'],
1746         ['exclude', 'inspector/InspectorFrontendClientLocal\\.cpp$'],
1747         ['exclude', 'inspector/JavaScript[^/]*\\.cpp$'],
1748         ['exclude', 'loader/UserStyleSheetLoader\\.cpp$'],
1749         ['exclude', 'loader/appcache/'],
1750         ['exclude', 'loader/archive/cf/LegacyWebArchiveMac\\.mm$'],
1751         ['exclude', 'loader/archive/cf/LegacyWebArchive\\.cpp$'],
1752         ['exclude', 'loader/icon/IconDatabase\\.cpp$'],
1753         ['exclude', 'plugins/PluginDataNone\\.cpp$'],
1754         ['exclude', 'plugins/PluginDatabase\\.cpp$'],
1755         ['exclude', 'plugins/PluginMainThreadScheduler\\.cpp$'],
1756         ['exclude', 'plugins/PluginPackageNone\\.cpp$'],
1757         ['exclude', 'plugins/PluginPackage\\.cpp$'],
1758         ['exclude', 'plugins/PluginStream\\.cpp$'],
1759         ['exclude', 'plugins/PluginView\\.cpp$'],
1760         ['exclude', 'plugins/npapi\\.cpp$'],
1761         ['exclude', 'storage/DatabaseTrackerClient\\.h$'],
1762         ['exclude', 'storage/DatabaseTracker\\.cpp$'],
1763         ['exclude', 'storage/IDBFactoryBackendInterface\\.cpp$'],
1764         ['exclude', 'storage/IDBKeyPathBackendImpl\\.cpp$'],
1765         ['exclude', 'storage/OriginQuotaManager\\.(cpp|h)$'],
1766         ['exclude', 'storage/OriginUsageRecord\\.(cpp|h)$'],
1767         ['exclude', 'storage/SQLTransactionClient\\.cpp$'],
1768         ['exclude', 'storage/StorageEventDispatcher\\.cpp$'],
1769         ['exclude', 'storage/StorageNamespace\\.cpp$'],
1770         ['exclude', 'workers/DefaultSharedWorkerRepository\\.(cpp|h)$'],
1771
1772         ['include', 'loader/appcache/ApplicationCacheHost\.h$'],
1773         ['include', 'loader/appcache/DOMApplicationCache\.(cpp|h)$'],
1774       ],
1775       'link_settings': {
1776         'mac_bundle_resources': [
1777           '../Resources/aliasCursor.png',
1778           '../Resources/cellCursor.png',
1779           '../Resources/contextMenuCursor.png',
1780           '../Resources/copyCursor.png',
1781           '../Resources/eastResizeCursor.png',
1782           '../Resources/eastWestResizeCursor.png',
1783           '../Resources/helpCursor.png',
1784           '../Resources/linkCursor.png',
1785           '../Resources/missingImage.png',
1786           '../Resources/moveCursor.png',
1787           '../Resources/noDropCursor.png',
1788           '../Resources/noneCursor.png',
1789           '../Resources/northEastResizeCursor.png',
1790           '../Resources/northEastSouthWestResizeCursor.png',
1791           '../Resources/northResizeCursor.png',
1792           '../Resources/northSouthResizeCursor.png',
1793           '../Resources/northWestResizeCursor.png',
1794           '../Resources/northWestSouthEastResizeCursor.png',
1795           '../Resources/progressCursor.png',
1796           '../Resources/southEastResizeCursor.png',
1797           '../Resources/southResizeCursor.png',
1798           '../Resources/southWestResizeCursor.png',
1799           '../Resources/verticalTextCursor.png',
1800           '../Resources/waitCursor.png',
1801           '../Resources/westResizeCursor.png',
1802           '../Resources/zoomInCursor.png',
1803           '../Resources/zoomOutCursor.png',
1804         ],
1805       },
1806       'conditions': [
1807         # Shard this taret into ten parts to work around linker limitations.
1808         # on link time code generation builds.
1809         ['OS=="win" and buildtype=="Official"', {
1810           'msvs_shard': 10,
1811         }],
1812         ['OS=="win"', {
1813           'sources/': [
1814             ['exclude', 'Posix\\.cpp$'],
1815             ['include', '/opentype/'],
1816             ['include', '/SkiaFontWin\\.cpp$'],
1817             ['include', '/TransparencyWin\\.cpp$'],
1818           ],
1819         }],
1820         ['os_posix == 1 and OS != "mac" and OS != "android" and gcc_version == 42', {
1821           # Due to a bug in gcc 4.2.1 (the current version on hardy), we get
1822           # warnings about uninitialized this.
1823           'cflags': ['-Wno-uninitialized'],
1824         }],
1825         ['use_x11 == 0', {
1826           'sources/': [
1827             ['exclude', 'Linux\\.cpp$'],
1828           ],
1829         }],
1830         ['toolkit_uses_gtk == 0', {
1831           'sources/': [
1832             ['exclude', 'Gtk\\.cpp$'],
1833           ],
1834         }],
1835         ['OS!="mac"', {
1836           'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
1837         }],
1838         ['OS!="win"', {
1839           'sources/': [
1840             ['exclude', 'Win\\.cpp$'],
1841             ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$']
1842           ],
1843         }],
1844       ],
1845     },
1846     {
1847       'target_name': 'webcore',
1848       'type': 'none',
1849       'dependencies': [
1850         'webcore_arm_neon',
1851         'webcore_dom',
1852         'webcore_html',
1853         'webcore_platform',
1854         'webcore_remaining',
1855         'webcore_rendering',
1856         # Exported.
1857         'webcore_bindings',
1858         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
1859         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
1860         '<(chromium_src_dir)/skia/skia.gyp:skia',
1861         '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
1862         '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
1863       ],
1864       'export_dependent_settings': [
1865         'webcore_bindings',
1866         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
1867         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
1868         '<(chromium_src_dir)/skia/skia.gyp:skia',
1869         '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
1870         '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
1871       ],
1872       'direct_dependent_settings': {
1873         'include_dirs': [
1874           '<@(webcore_include_dirs)',
1875         ],
1876         'mac_framework_dirs': [
1877           '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks',
1878           '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
1879           '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
1880           '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
1881           '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
1882           '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
1883           '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
1884           '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
1885         ],
1886       },
1887       'conditions': [
1888         ['OS=="mac"', {
1889           'direct_dependent_settings': {
1890             'include_dirs': [
1891               '../../../WebKitLibraries',
1892               '../../WebKit/mac/WebCoreSupport',
1893             ],
1894           },
1895         }],
1896         ['OS=="win"', {
1897           'direct_dependent_settings': {
1898             'include_dirs+++': ['../dom'],
1899           },
1900         }],
1901         ['OS=="linux" and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', {
1902           # FIXME: (kbr) figure out how to make these dependencies
1903           # work in a cross-platform way. Attempts to use
1904           # "link_settings" and "libraries" in conjunction with the
1905           # msvs-specific settings didn't work so far.
1906           'all_dependent_settings': {
1907             'ldflags': [
1908               # FIXME: (kbr) build the FFTW into PRODUCT_DIR using GYP.
1909               '-Lthird_party/fftw/.libs',
1910             ],
1911             'link_settings': {
1912               'libraries': [
1913                 '-lfftw3f'
1914               ],
1915             },
1916           },
1917         }],
1918         ['enable_svg!=0', {
1919           'dependencies': [
1920             'webcore_svg',
1921           ],
1922         }],
1923       ],
1924     },
1925     {
1926       'target_name': 'webcore_test_support',
1927       'type': 'static_library',
1928       'dependencies': [
1929         'webcore',
1930       ],
1931       'include_dirs': [
1932         '<(INTERMEDIATE_DIR)',
1933         '<(SHARED_INTERMEDIATE_DIR)/webcore',
1934         '<(SHARED_INTERMEDIATE_DIR)/webkit',
1935         '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
1936         '<@(webcore_include_dirs)',
1937         '../testing',
1938         '../testing/v8',
1939       ],
1940       'sources': [
1941         '<@(webcore_test_support_files)',
1942         '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8Internals.cpp',
1943         '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8Internals.h',
1944       ],
1945       'sources/': [
1946         ['exclude', 'testing/js'],
1947       ],
1948     },
1949   ],  # targets
1950 }