Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / core.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     '../build/win/precompile.gypi',
34     '../build/features.gypi',
35     '../build/scripts/scripts.gypi',
36     '../bindings/bindings.gypi',
37     'core.gypi',
38   ],
39
40   'variables': {
41     'enable_wexit_time_destructors': 1,
42
43     'webcore_include_dirs': [
44       '../..',
45       '..',
46       '<(SHARED_INTERMEDIATE_DIR)/blink',
47       '<(bindings_output_dir)',
48     ],
49
50     'conditions': [
51       ['OS=="android" and use_openmax_dl_fft!=0', {
52         'webcore_include_dirs': [
53           '<(DEPTH)/third_party/openmax_dl'
54         ]
55       }],
56     ],
57   },  # variables
58
59   'target_defaults': {
60     'variables': {
61       'optimize': 'max',
62     },
63   },
64
65   'targets': [
66     {
67       'target_name': 'inspector_protocol_sources',
68       'type': 'none',
69       'dependencies': [
70         'generate_inspector_protocol_version'
71       ],
72       'actions': [
73         {
74           'action_name': 'generateInspectorProtocolBackendSources',
75           'inputs': [
76             # The python script in action below.
77             'inspector/CodeGeneratorInspector.py',
78             # The helper script imported by CodeGeneratorInspector.py.
79             'inspector/CodeGeneratorInspectorStrings.py',
80             # Input file for the script.
81             '../devtools/protocol.json',
82           ],
83           'outputs': [
84             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorBackendDispatcher.cpp',
85             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorBackendDispatcher.h',
86             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorFrontend.cpp',
87             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorFrontend.h',
88             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorTypeBuilder.cpp',
89             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorTypeBuilder.h',
90           ],
91           'variables': {
92             'generator_include_dirs': [
93             ],
94           },
95           'action': [
96             'python',
97             'inspector/CodeGeneratorInspector.py',
98             '../devtools/protocol.json',
99             '--output_dir', '<(SHARED_INTERMEDIATE_DIR)/blink',
100           ],
101           'message': 'Generating Inspector protocol backend sources from protocol.json',
102         },
103       ]
104     },
105     {
106       'target_name': 'inspector_instrumentation_sources',
107       'type': 'none',
108       'dependencies': [],
109       'actions': [
110         {
111           'action_name': 'generateInspectorInstrumentation',
112           'inputs': [
113             # The python script in action below.
114             'inspector/CodeGeneratorInstrumentation.py',
115             # Input file for the script.
116             'inspector/InspectorInstrumentation.idl',
117           ],
118           'outputs': [
119             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorCanvasInstrumentationInl.h',
120             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorConsoleInstrumentationInl.h',
121             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorInstrumentationInl.h',
122             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorOverridesInl.h',
123             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorPromiseInstrumentationInl.h',
124             '<(SHARED_INTERMEDIATE_DIR)/blink/InstrumentingAgentsInl.h',
125             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorInstrumentationImpl.cpp',
126           ],
127           'action': [
128             'python',
129             'inspector/CodeGeneratorInstrumentation.py',
130             'inspector/InspectorInstrumentation.idl',
131             '--output_dir', '<(SHARED_INTERMEDIATE_DIR)/blink',
132           ],
133           'message': 'Generating Inspector instrumentation code from InspectorInstrumentation.idl',
134         }
135       ]
136     },
137     {
138       'target_name': 'generate_inspector_protocol_version',
139       'type': 'none',
140       'actions': [
141          {
142           'action_name': 'generateInspectorProtocolVersion',
143           'inputs': [
144             'inspector/generate-inspector-protocol-version',
145             '../devtools/protocol.json',
146           ],
147           'outputs': [
148             '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorProtocolVersion.h',
149           ],
150           'variables': {
151             'generator_include_dirs': [
152             ],
153           },
154           'action': [
155             'python',
156             'inspector/generate-inspector-protocol-version',
157             '-o',
158             '<@(_outputs)',
159             '<@(_inputs)'
160           ],
161           'message': 'Validate inspector protocol for backwards compatibility and generate version file',
162         }
163       ]
164     },
165     {
166       'target_name': 'inspector_overlay_page',
167       'type': 'none',
168       'variables': {
169         'input_file_path': 'inspector/InspectorOverlayPage.html',
170         'output_file_path': '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorOverlayPage.h',
171         'character_array_name': 'InspectorOverlayPage_html',
172       },
173       'includes': [ '../build/ConvertFileToHeaderWithCharacterArray.gypi' ],
174     },
175     {
176       'target_name': 'injected_canvas_script_source',
177       'type': 'none',
178       'variables': {
179         'input_file_path': 'inspector/InjectedScriptCanvasModuleSource.js',
180         'output_file_path': '<(SHARED_INTERMEDIATE_DIR)/blink/InjectedScriptCanvasModuleSource.h',
181         'character_array_name': 'InjectedScriptCanvasModuleSource_js',
182       },
183       'includes': [ '../build/ConvertFileToHeaderWithCharacterArray.gypi' ],
184     },
185     {
186       'target_name': 'injected_script_source',
187       'type': 'none',
188       'variables': {
189         'input_file_path': 'inspector/InjectedScriptSource.js',
190         'output_file_path': '<(SHARED_INTERMEDIATE_DIR)/blink/InjectedScriptSource.h',
191         'character_array_name': 'InjectedScriptSource_js',
192       },
193       'includes': [ '../build/ConvertFileToHeaderWithCharacterArray.gypi' ],
194     },
195     {
196       'target_name': 'debugger_script_source',
197       'type': 'none',
198       'variables': {
199         'input_file_path': '<(bindings_v8_dir)/DebuggerScript.js',
200         'output_file_path': '<(SHARED_INTERMEDIATE_DIR)/blink/DebuggerScriptSource.h',
201         'character_array_name': 'DebuggerScriptSource_js',
202       },
203       'includes': [ '../build/ConvertFileToHeaderWithCharacterArray.gypi' ],
204     },
205     {
206       'target_name': 'webcore_generated',
207       'type': 'static_library',
208       'hard_dependency': 1,
209       'dependencies': [
210         'webcore_prerequisites',
211         'core_generated.gyp:make_core_generated',
212         'inspector_overlay_page',
213         'inspector_protocol_sources',
214         'inspector_instrumentation_sources',
215         'injected_canvas_script_source',
216         'injected_script_source',
217         'debugger_script_source',
218         '../bindings/generated_bindings.gyp:generated_bindings',
219         '../platform/platform_generated.gyp:make_platform_generated',
220         '../wtf/wtf.gyp:wtf',
221         '<(DEPTH)/gin/gin.gyp:gin',
222         '<(DEPTH)/skia/skia.gyp:skia',
223         '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
224         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
225         '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
226         '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
227         '<(DEPTH)/third_party/libxslt/libxslt.gyp:libxslt',
228         '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
229         '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
230         '<(DEPTH)/third_party/sqlite/sqlite.gyp:sqlite',
231         '<(DEPTH)/url/url.gyp:url_lib',
232         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
233       ],
234       'include_dirs': [
235         '<(SHARED_INTERMEDIATE_DIR)/blink',
236         '<(bindings_output_dir)',
237         '<@(webcore_include_dirs)',
238
239         # FIXME: Remove these once the bindings script generates qualified
240         # includes for these correctly. (Sequences don't work yet.)
241         '<(bindings_v8_dir)/custom',
242         'html',
243         'html/shadow',
244         'inspector',
245         'svg',
246       ],
247       'sources': [
248         '<@(bindings_files)',
249         # These files include all the .cpp files generated from the .idl files
250         # in webcore_files.
251         '<@(bindings_core_generated_aggregate_files)',
252
253         # Additional .cpp files for HashTools.h
254         '<(SHARED_INTERMEDIATE_DIR)/blink/CSSPropertyNames.cpp',
255         '<(SHARED_INTERMEDIATE_DIR)/blink/CSSValueKeywords.cpp',
256
257         # Additional .cpp files from make_core_generated actions.
258         '<(SHARED_INTERMEDIATE_DIR)/blink/Event.cpp',
259         '<(SHARED_INTERMEDIATE_DIR)/blink/EventHeaders.h',
260         '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.h',
261         '<(SHARED_INTERMEDIATE_DIR)/blink/EventNames.cpp',
262         '<(SHARED_INTERMEDIATE_DIR)/blink/EventNames.h',
263         '<(SHARED_INTERMEDIATE_DIR)/blink/EventTargetHeaders.h',
264         '<(SHARED_INTERMEDIATE_DIR)/blink/EventTargetInterfaces.h',
265         '<(SHARED_INTERMEDIATE_DIR)/blink/EventTargetNames.cpp',
266         '<(SHARED_INTERMEDIATE_DIR)/blink/EventTargetNames.h',
267         '<(SHARED_INTERMEDIATE_DIR)/blink/EventTypeNames.cpp',
268         '<(SHARED_INTERMEDIATE_DIR)/blink/EventTypeNames.h',
269         '<(SHARED_INTERMEDIATE_DIR)/blink/FetchInitiatorTypeNames.cpp',
270         '<(SHARED_INTERMEDIATE_DIR)/blink/HTMLElementFactory.cpp',
271         '<(SHARED_INTERMEDIATE_DIR)/blink/HTMLElementFactory.h',
272         '<(SHARED_INTERMEDIATE_DIR)/blink/HTMLElementLookupTrie.cpp',
273         '<(SHARED_INTERMEDIATE_DIR)/blink/HTMLElementLookupTrie.h',
274         '<(SHARED_INTERMEDIATE_DIR)/blink/HTMLNames.cpp',
275         '<(SHARED_INTERMEDIATE_DIR)/blink/HTMLTokenizerNames.cpp',
276         '<(SHARED_INTERMEDIATE_DIR)/blink/InputTypeNames.cpp',
277         '<(SHARED_INTERMEDIATE_DIR)/blink/MathMLNames.cpp',
278         '<(SHARED_INTERMEDIATE_DIR)/blink/SVGNames.cpp',
279         '<(SHARED_INTERMEDIATE_DIR)/blink/UserAgentStyleSheetsData.cpp',
280         '<(SHARED_INTERMEDIATE_DIR)/blink/V8HTMLElementWrapperFactory.cpp',
281         '<(SHARED_INTERMEDIATE_DIR)/blink/XLinkNames.cpp',
282         '<(SHARED_INTERMEDIATE_DIR)/blink/XMLNSNames.cpp',
283         '<(SHARED_INTERMEDIATE_DIR)/blink/XMLNames.cpp',
284
285         # Generated from HTMLEntityNames.in
286         '<(SHARED_INTERMEDIATE_DIR)/blink/HTMLEntityTable.cpp',
287
288         # Generated from MediaFeatureNames.in
289         '<(SHARED_INTERMEDIATE_DIR)/blink/MediaFeatureNames.cpp',
290
291         # Generated from MediaTypeNames.in
292         '<(SHARED_INTERMEDIATE_DIR)/blink/MediaTypeNames.cpp',
293
294         # Generated from CSSTokenizer-in.cpp
295         '<(SHARED_INTERMEDIATE_DIR)/blink/CSSTokenizer.cpp',
296
297         # Generated from BisonCSSParser-in.cpp
298         '<(SHARED_INTERMEDIATE_DIR)/blink/BisonCSSParser.cpp',
299
300         # Generated from HTMLMetaElement-in.cpp
301         '<(SHARED_INTERMEDIATE_DIR)/blink/HTMLMetaElement.cpp',
302
303         # Additional .cpp files from the make_core_generated rules.
304         '<(SHARED_INTERMEDIATE_DIR)/blink/CSSGrammar.cpp',
305         '<(SHARED_INTERMEDIATE_DIR)/blink/XPathGrammar.cpp',
306
307         # Additional .cpp files from the inspector_protocol_sources list.
308         '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorFrontend.cpp',
309         '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorBackendDispatcher.cpp',
310         '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorTypeBuilder.cpp',
311
312         # Additional .cpp files from the inspector_instrumentation_sources list.
313         '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorCanvasInstrumentationInl.h',
314         '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorConsoleInstrumentationInl.h',
315         '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorInstrumentationInl.h',
316         '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorOverridesInl.h',
317         '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorPromiseInstrumentationInl.h',
318         '<(SHARED_INTERMEDIATE_DIR)/blink/InstrumentingAgentsInl.h',
319         '<(SHARED_INTERMEDIATE_DIR)/blink/InspectorInstrumentationImpl.cpp',
320
321         # Additional .cpp files for SVG.
322         '<(SHARED_INTERMEDIATE_DIR)/blink/SVGElementFactory.cpp',
323         '<(SHARED_INTERMEDIATE_DIR)/blink/V8SVGElementWrapperFactory.cpp',
324
325         # Generated from make_style_shorthands.py
326         '<(SHARED_INTERMEDIATE_DIR)/blink/StylePropertyShorthand.cpp',
327
328         # Generated from make_style_builder.py
329         '<(SHARED_INTERMEDIATE_DIR)/blink/StyleBuilder.cpp',
330         '<(SHARED_INTERMEDIATE_DIR)/blink/StyleBuilderFunctions.cpp',
331       ],
332       'conditions': [
333         ['OS=="win" and component=="shared_library"', {
334           'defines': [
335             'USING_V8_SHARED',
336           ],
337         }],
338         ['OS=="win"', {
339           # In generated bindings code: 'switch contains default but no case'.
340           # Disable c4267 warnings until we fix size_t to int truncations.
341           # 4702 is disabled because of issues in Bison-generated
342           # XPathGrammar.cpp and CSSGrammar.cpp.
343           'msvs_disabled_warnings': [ 4065, 4267, 4702 ],
344         }],
345         ['OS in ("linux", "android") and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines', {
346           'cflags': [
347             '<!@(pkg-config --cflags-only-I ipp)',
348           ],
349         }],
350       ],
351     },
352     {
353       # We'll soon split libwebcore in multiple smaller libraries.
354       # webcore_prerequisites will be the 'base' target of every sub-target.
355       'target_name': 'webcore_prerequisites',
356       'type': 'none',
357       'dependencies': [
358         'debugger_script_source',
359         'injected_canvas_script_source',
360         'injected_script_source',
361         'inspector_overlay_page',
362         'inspector_protocol_sources',
363         'inspector_instrumentation_sources',
364         '../bindings/generated_bindings.gyp:generated_bindings',
365         'core_generated.gyp:make_core_generated',
366         '../wtf/wtf.gyp:wtf',
367         '../config.gyp:config',
368         '../platform/blink_platform.gyp:blink_platform',
369         '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
370         '<(DEPTH)/skia/skia.gyp:skia',
371         '<(angle_path)/src/build_angle.gyp:translator',
372         '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
373         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
374         '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
375         '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
376         '<(DEPTH)/third_party/libxslt/libxslt.gyp:libxslt',
377         '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
378         '<(DEPTH)/third_party/ots/ots.gyp:ots',
379         '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
380         '<(DEPTH)/third_party/sqlite/sqlite.gyp:sqlite',
381         '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
382         '<(DEPTH)/url/url.gyp:url_lib',
383         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
384       ],
385       'export_dependent_settings': [
386         '../wtf/wtf.gyp:wtf',
387         '../config.gyp:config',
388         '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
389         '<(DEPTH)/skia/skia.gyp:skia',
390         '<(angle_path)/src/build_angle.gyp:translator',
391         '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
392         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
393         '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
394         '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
395         '<(DEPTH)/third_party/libxslt/libxslt.gyp:libxslt',
396         '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
397         '<(DEPTH)/third_party/ots/ots.gyp:ots',
398         '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
399         '<(DEPTH)/third_party/sqlite/sqlite.gyp:sqlite',
400         '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
401         '<(DEPTH)/url/url.gyp:url_lib',
402         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
403       ],
404       'direct_dependent_settings': {
405         'defines': [
406           'BLINK_IMPLEMENTATION=1',
407           'INSIDE_BLINK',
408         ],
409         'include_dirs': [
410           '<@(webcore_include_dirs)',
411           '<(DEPTH)/gpu',
412           '<(angle_path)/include',
413         ],
414         'xcode_settings': {
415           # Some Mac-specific parts of WebKit won't compile without having this
416           # prefix header injected.
417           # FIXME: make this a first-class setting.
418           'GCC_PREFIX_HEADER': 'WebCorePrefixMac.h',
419         },
420       },
421       'conditions': [
422         ['OS=="win" and component=="shared_library"', {
423           'direct_dependent_settings': {
424             'defines': [
425                'USING_V8_SHARED',
426             ],
427           },
428         }],
429         ['use_x11 == 1', {
430           'dependencies': [
431             '<(DEPTH)/build/linux/system.gyp:fontconfig',
432           ],
433           'export_dependent_settings': [
434             '<(DEPTH)/build/linux/system.gyp:fontconfig',
435           ],
436           'direct_dependent_settings': {
437             'cflags': [
438               # WebCore does not work with strict aliasing enabled.
439               # https://bugs.webkit.org/show_bug.cgi?id=25864
440               '-fno-strict-aliasing',
441             ],
442           },
443         }],
444         ['OS=="android"', {
445           'sources/': [
446             ['exclude', 'accessibility/'],
447           ],
448         }],
449         ['OS in ("linux", "android") and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines', {
450           'direct_dependent_settings': {
451             'cflags': [
452               '<!@(pkg-config --cflags-only-I ipp)',
453             ],
454           },
455         }],
456         ['OS=="mac"', {
457           'direct_dependent_settings': {
458             'defines': [
459               # Chromium's version of WebCore includes the following Objective-C
460               # classes. The system-provided WebCore framework may also provide
461               # these classes. Because of the nature of Objective-C binding
462               # (dynamically at runtime), it's possible for the
463               # Chromium-provided versions to interfere with the system-provided
464               # versions.  This may happen when a system framework attempts to
465               # use core.framework, such as when converting an HTML-flavored
466               # string to an NSAttributedString.  The solution is to force
467               # Objective-C class names that would conflict to use alternate
468               # names.
469               #
470               # This list will hopefully shrink but may also grow.  Its
471               # performance is monitored by the "Check Objective-C Rename"
472               # postbuild step, and any suspicious-looking symbols not handled
473               # here or whitelisted in that step will cause a build failure.
474               #
475               # If this is unhandled, the console will receive log messages
476               # such as:
477               # 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.
478               'WebCoreTextFieldCell=ChromiumWebCoreObjCWebCoreTextFieldCell',
479               'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver',
480             ],
481             'postbuilds': [
482               {
483                 # This step ensures that any Objective-C names that aren't
484                 # redefined to be "safe" above will cause a build failure.
485                 'postbuild_name': 'Check Objective-C Rename',
486                 'variables': {
487                   'class_whitelist_regex':
488                       'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView|ScrollerStyleObserver',
489                   'category_whitelist_regex':
490                       'TCMInterposing|ScrollAnimatorChromiumMacExt|WebCoreTheme',
491                 },
492                 'action': [
493                   '../build/scripts/check_objc_rename.sh',
494                   '<(class_whitelist_regex)',
495                   '<(category_whitelist_regex)',
496                 ],
497               },
498             ],
499           },
500         }],
501         ['"WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', {
502           # This directory needs to be on the include path for multiple sub-targets of webcore.
503           'direct_dependent_settings': {
504             'include_dirs': [
505               '<(DEPTH)/third_party/ffmpeg',
506             ],
507           },
508           'dependencies': [
509             '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
510           ],
511         }],
512        ['"WTF_USE_WEBAUDIO_OPENMAX_DL_FFT=1" in feature_defines', {
513          'direct_dependent_settings': {
514            'include_dirs': [
515              '<(DEPTH)/third_party/openmax_dl',
516            ],
517          },
518          'dependencies': [
519            '<(DEPTH)/third_party/openmax_dl/dl/dl.gyp:openmax_dl',
520          ],
521        }],
522         # Windows shared builder needs extra help for linkage
523         ['OS=="win" and "WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', {
524           'export_dependent_settings': [
525             '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
526           ],
527         }],
528       ],
529     },
530     {
531       'target_name': 'webcore_dom',
532       'type': 'static_library',
533       'dependencies': [
534         'webcore_prerequisites',
535       ],
536       'sources': [
537         '<@(webcore_dom_files)',
538       ],
539       # Disable c4267 warnings until we fix size_t to int truncations.
540       'msvs_disabled_warnings': [ 4267, ],
541     },
542     {
543       'target_name': 'webcore_html',
544       'type': 'static_library',
545       'dependencies': [
546         'webcore_prerequisites',
547       ],
548       'sources': [
549         '<@(webcore_html_files)',
550       ],
551       'conditions': [
552         # Shard this taret into parts to work around linker limitations.
553         # on link time code generation builds.
554         ['OS=="win" and buildtype=="Official"', {
555           'msvs_shard': 5,
556         }],
557         ['OS!="android"', {
558           'sources/': [
559             ['exclude', 'Android\\.cpp$'],
560           ],
561         }],
562       ],
563     },
564     {
565       'target_name': 'webcore_svg',
566       'type': 'static_library',
567       'dependencies': [
568         'webcore_prerequisites',
569       ],
570       'sources': [
571         '<@(webcore_svg_files)',
572       ],
573       'conditions': [
574         ['OS=="win" and buildtype=="Official"', {
575           'msvs_shard': 5,
576         }],
577       ],
578     },
579     {
580       'target_name': 'webcore_rendering',
581       'type': 'static_library',
582       'dependencies': [
583         'webcore_prerequisites',
584       ],
585       'sources': [
586         '<@(webcore_files)',
587       ],
588       'sources/': [
589         ['exclude', '.*'],
590         ['include', 'rendering/'],
591
592         # FIXME: Figure out how to store these patterns in a variable.
593         ['exclude', '(cf|cg|mac|opentype|svg|win)/'],
594         ['exclude', '(?<!Chromium)(CF|CG|Mac|Win)\\.(cpp|mm?)$'],
595         # Previous rule excludes things like ChromiumFooWin, include those.
596         ['include', 'rendering/.*Chromium.*\\.(cpp|mm?)$'],
597       ],
598       'conditions': [
599         # Shard this taret into parts to work around linker limitations.
600         # on link time code generation builds.
601         ['OS=="win" and buildtype=="Official"', {
602           'msvs_shard': 5,
603         }],
604         ['use_default_render_theme==0', {
605           'sources/': [
606             ['exclude', 'rendering/RenderThemeChromiumDefault.*'],
607           ],
608         }],
609         ['OS=="win"', {
610           'sources/': [
611             ['exclude', 'Posix\\.cpp$'],
612           ],
613         },{ # OS!="win"
614           'sources/': [
615             ['exclude', 'Win\\.cpp$'],
616           ],
617         }],
618         ['OS=="win" and chromium_win_pch==1', {
619           'sources/': [
620             ['include', '<(DEPTH)/third_party/WebKit/Source/build/win/Precompile.cpp'],
621           ],
622         }],
623         ['OS=="mac"', {
624           'sources/': [
625             # RenderThemeChromiumSkia is not used on mac since RenderThemeChromiumMac
626             # does not reference the Skia code that is used by Windows, Linux and Android.
627             ['exclude', 'rendering/RenderThemeChromiumSkia\\.cpp$'],
628             # RenderThemeChromiumFontProvider is used by RenderThemeChromiumSkia.
629             ['exclude', 'rendering/RenderThemeChromiumFontProvider\\.cpp'],
630             ['exclude', 'rendering/RenderThemeChromiumFontProvider\\.h'],
631           ],
632         },{ # OS!="mac"
633           'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
634         }],
635         ['OS == "android" and target_arch == "ia32" and gcc_version == 46', {
636           # Due to a bug in gcc 4.6 in android NDK, we get warnings about uninitialized variable.
637           'cflags': ['-Wno-uninitialized'],
638         }],
639         ['OS != "linux"', {
640           'sources/': [
641             ['exclude', 'Linux\\.cpp$'],
642           ],
643         }],
644         ['OS=="android"', {
645           'sources/': [
646             ['include', 'rendering/RenderThemeChromiumFontProviderLinux\\.cpp$'],
647             ['include', 'rendering/RenderThemeChromiumDefault\\.cpp$'],
648           ],
649         },{ # OS!="android"
650           'sources/': [
651             ['exclude', 'Android\\.cpp$'],
652           ],
653         }],
654       ],
655     },
656     {
657       'target_name': 'webcore_remaining',
658       'type': 'static_library',
659       'dependencies': [
660         'webcore_prerequisites',
661       ],
662       'sources': [
663         '<@(webcore_files)',
664       ],
665       'sources/': [
666         ['exclude', 'rendering/'],
667
668         # FIXME: Figure out how to store these patterns in a variable.
669         ['exclude', '(cf|cg|mac|opentype|svg|win)/'],
670         ['exclude', '(?<!Chromium)(CF|CG|Mac|Win)\\.(cpp|mm?)$'],
671       ],
672       'conditions': [
673         # Shard this taret into parts to work around linker limitations.
674         # on link time code generation builds.
675         ['OS=="win" and buildtype=="Official"', {
676           'msvs_shard': 19,
677         }],
678         ['OS != "linux"', {
679           'sources/': [
680             ['exclude', 'Linux\\.cpp$'],
681           ],
682         }],
683         ['OS=="android"', {
684           'cflags': [
685             # WebCore does not work with strict aliasing enabled.
686             # https://bugs.webkit.org/show_bug.cgi?id=25864
687             '-fno-strict-aliasing',
688           ],
689         }, { # OS!="android"
690           'sources/': [['exclude', 'Android\\.cpp$']]
691         }],
692         ['OS=="mac"', {
693           'sources': [
694             'editing/SmartReplaceCF.cpp',
695           ],
696           'link_settings': {
697             'libraries': [
698               '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
699             ],
700           },
701           'sources/': [
702             # Additional files from the WebCore Mac build that are presently
703             # used in the WebCore Chromium Mac build too.
704
705             # The Mac build is USE(CF).
706             ['include', 'CF\\.cpp$'],
707
708             # Cherry-pick some files that can't be included by broader regexps.
709             # Some of these are used instead of Chromium platform files, see
710             # the specific exclusions in the "exclude" list below.
711             ['include', 'platform/mac/WebCoreSystemInterface\\.h$'],
712             ['include', 'platform/mac/WebCoreTextRenderer\\.mm$'],
713             ['include', 'platform/text/mac/ShapeArabic\\.c$'],
714             ['include', 'platform/text/mac/String(Impl)?Mac\\.mm$'],
715             # Use USE_NEW_THEME on Mac.
716             ['include', 'platform/Theme\\.cpp$'],
717           ],
718         }, { # OS!="mac"
719           'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
720         }],
721         ['OS=="win" and chromium_win_pch==1', {
722           'sources/': [
723             ['include', '<(DEPTH)/third_party/WebKit/Source/build/win/Precompile.cpp'],
724           ],
725         }],
726       ],
727       # Disable c4267 warnings until we fix size_t to int truncations.
728       'msvs_disabled_warnings': [ 4267, 4334, ],
729     },
730     {
731       'target_name': 'webcore',
732       'type': 'none',
733       'dependencies': [
734         'webcore_dom',
735         'webcore_html',
736         'webcore_remaining',
737         'webcore_rendering',
738         'webcore_svg',
739         # Exported.
740         'webcore_generated',
741         '../wtf/wtf.gyp:wtf',
742         '<(DEPTH)/skia/skia.gyp:skia',
743         '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
744         '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
745         '<(DEPTH)/url/url.gyp:url_lib',
746         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
747       ],
748       'export_dependent_settings': [
749         '../wtf/wtf.gyp:wtf',
750         'webcore_generated',
751         '<(DEPTH)/skia/skia.gyp:skia',
752         '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
753         '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
754         '<(DEPTH)/url/url.gyp:url_lib',
755         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
756       ],
757       'direct_dependent_settings': {
758         'include_dirs': [
759           '<@(webcore_include_dirs)',
760         ],
761       },
762       'conditions': [
763         ['OS=="linux" and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines', {
764           'link_settings': {
765             'ldflags': [
766               '<!@(pkg-config --libs-only-L ipp)',
767             ],
768             'libraries': [
769               '-lipps -lippcore',
770             ],
771           },
772         }],
773         # Use IPP static libraries for x86 Android.
774         ['OS=="android" and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines', {
775           'link_settings': {
776             'libraries': [
777                '<!@(pkg-config --libs ipp|sed s/-L//)/libipps_l.a',
778                '<!@(pkg-config --libs ipp|sed s/-L//)/libippcore_l.a',
779             ]
780           },
781         }],
782       ],
783     },
784     {
785       'target_name': 'webcore_testing',
786       'type': 'static_library',
787       'dependencies': [
788         '../config.gyp:config',
789         'webcore',
790       ],
791       'defines': [
792         'BLINK_IMPLEMENTATION=1',
793         'INSIDE_BLINK',
794       ],
795       'include_dirs': [
796         '<(bindings_v8_dir)',  # FIXME: Remove once http://crbug.com/236119 is fixed.
797         'testing',
798         'testing/v8',
799       ],
800       'sources': [
801         '<@(webcore_testing_files)',
802         '<(bindings_output_dir)/V8GCObservation.cpp',
803         '<(bindings_output_dir)/V8GCObservation.h',
804         '<(bindings_output_dir)/V8MallocStatistics.cpp',
805         '<(bindings_output_dir)/V8MallocStatistics.h',
806         '<(bindings_output_dir)/V8TypeConversions.cpp',
807         '<(bindings_output_dir)/V8TypeConversions.h',
808         '<(bindings_output_dir)/V8Internals.cpp',
809         '<(bindings_output_dir)/V8Internals.h',
810         '<(bindings_output_dir)/V8InternalProfilers.cpp',
811         '<(bindings_output_dir)/V8InternalProfilers.h',
812         '<(bindings_output_dir)/V8InternalSettings.cpp',
813         '<(bindings_output_dir)/V8InternalSettings.h',
814         '<(bindings_output_dir)/V8InternalSettingsGenerated.cpp',
815         '<(bindings_output_dir)/V8InternalSettingsGenerated.h',
816         '<(bindings_output_dir)/V8InternalRuntimeFlags.cpp',
817         '<(bindings_output_dir)/V8InternalRuntimeFlags.h',
818         '<(bindings_output_dir)/V8LayerRect.cpp',
819         '<(bindings_output_dir)/V8LayerRect.h',
820         '<(bindings_output_dir)/V8LayerRectList.cpp',
821         '<(bindings_output_dir)/V8LayerRectList.h',
822       ],
823       'sources/': [
824         ['exclude', 'testing/js'],
825       ],
826     },
827   ],  # targets
828 }