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