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