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