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