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