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