replace OVERRIDE and FINAL with override and final in ash/
[chromium-blink-merge.git] / content / content_shell.gypi
blobf302ef71a4c987dd3db5e623f7bd95f1c6251cf1
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'variables': {
7     'content_shell_product_name': 'Content Shell',
8     # The "19" is so that sites that sniff for version think that this is
9     # something reasonably current; the "77.34.5" is a hint that this isn't a
10     # standard Chrome.
11     'content_shell_version': '19.77.34.5',
12     'conditions': [
13       ['OS=="linux"', {
14        'use_custom_freetype%': 1,
15       }, {
16        'use_custom_freetype%': 0,
17       }],
18     ],
19   },
20   'targets': [
21     {
22       # GN version: //content/shell:content_shell_lib
23       'target_name': 'content_shell_lib',
24       'type': 'static_library',
25       'defines': ['CONTENT_SHELL_VERSION="<(content_shell_version)"'],
26       'variables': {
27         'chromium_code': 1,
28       },
29       'dependencies': [
30         'app/resources/content_resources.gyp:content_resources',
31         'app/strings/content_strings.gyp:content_strings',
32         'content.gyp:content_app_both',
33         'content.gyp:content_browser',
34         'content.gyp:content_common',
35         'content.gyp:content_gpu',
36         'content.gyp:content_plugin',
37         'content.gyp:content_ppapi_plugin',
38         'content.gyp:content_renderer',
39         'content.gyp:content_resources',
40         'content.gyp:content_utility',
41         'content_shell_resources',
42         'copy_test_netscape_plugin',
43         'layouttest_support_content',
44         '../base/base.gyp:base',
45         '../base/base.gyp:base_static',
46         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
47         '../cc/blink/cc_blink.gyp:cc_blink',
48         '../cc/cc.gyp:cc',
49         '../components/components.gyp:crash_component',
50         '../components/components.gyp:web_cache_renderer',
51         '../gin/gin.gyp:gin',
52         '../gpu/gpu.gyp:gpu',
53         '../ipc/ipc.gyp:ipc',
54         '../media/blink/media_blink.gyp:media_blink',
55         '../media/media.gyp:media',
56         '../net/net.gyp:net',
57         '../net/net.gyp:net_resources',
58         '../skia/skia.gyp:skia',
59         '../storage/storage_browser.gyp:storage',
60         '../third_party/WebKit/public/blink.gyp:blink',
61         '../third_party/WebKit/public/blink.gyp:blink_test_support',
62         '../ui/base/ui_base.gyp:ui_base',
63         '../ui/events/events.gyp:events_base',
64         '../ui/gfx/gfx.gyp:gfx',
65         '../ui/gfx/gfx.gyp:gfx_geometry',
66         '../ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc',
67         '../ui/gl/gl.gyp:gl',
68         '../url/url.gyp:url_lib',
69         '../v8/tools/gyp/v8.gyp:v8',
70       ],
71       'include_dirs': [
72         '..',
73       ],
74       'sources': [
75         # Note: sources list duplicated in GN build.
76         'shell/android/shell_jni_registrar.cc',
77         'shell/android/shell_jni_registrar.h',
78         'shell/android/shell_manager.cc',
79         'shell/android/shell_manager.h',
80         'shell/app/paths_mac.h',
81         'shell/app/paths_mac.mm',
82         'shell/app/shell_crash_reporter_client.cc',
83         'shell/app/shell_crash_reporter_client.h',
84         'shell/app/shell_main_delegate.cc',
85         'shell/app/shell_main_delegate.h',
86         'shell/app/shell_main_delegate_mac.h',
87         'shell/app/shell_main_delegate_mac.mm',
88         'shell/app/webkit_test_platform_support_android.cc',
89         'shell/app/webkit_test_platform_support.h',
90         'shell/app/webkit_test_platform_support_linux.cc',
91         'shell/app/webkit_test_platform_support_mac.mm',
92         'shell/app/webkit_test_platform_support_win.cc',
93         'shell/browser/ipc_echo_message_filter.cc',
94         'shell/browser/ipc_echo_message_filter.h',
95         'shell/browser/notify_done_forwarder.cc',
96         'shell/browser/notify_done_forwarder.h',
97         'shell/browser/shell_android.cc',
98         'shell/browser/shell_application_mac.h',
99         'shell/browser/shell_application_mac.mm',
100         'shell/browser/shell_aura.cc',
101         'shell/browser/shell_browser_context.cc',
102         'shell/browser/shell_browser_context.h',
103         'shell/browser/shell_browser_main.cc',
104         'shell/browser/shell_browser_main.h',
105         'shell/browser/shell_browser_main_parts.cc',
106         'shell/browser/shell_browser_main_parts.h',
107         'shell/browser/shell_browser_main_parts_mac.mm',
108         'shell/browser/shell.cc',
109         'shell/browser/shell_content_browser_client.cc',
110         'shell/browser/shell_content_browser_client.h',
111         'shell/browser/shell_devtools_delegate.cc',
112         'shell/browser/shell_devtools_delegate.h',
113         'shell/browser/shell_devtools_frontend.cc',
114         'shell/browser/shell_devtools_frontend.h',
115         'shell/browser/shell_download_manager_delegate.cc',
116         'shell/browser/shell_download_manager_delegate.h',
117         'shell/browser/shell.h',
118         'shell/browser/shell_javascript_dialog.h',
119         'shell/browser/shell_javascript_dialog_mac.mm',
120         'shell/browser/shell_javascript_dialog_manager.cc',
121         'shell/browser/shell_javascript_dialog_manager.h',
122         'shell/browser/shell_javascript_dialog_win.cc',
123         'shell/browser/shell_layout_tests_android.cc',
124         'shell/browser/shell_layout_tests_android.h',
125         'shell/browser/shell_login_dialog.cc',
126         'shell/browser/shell_login_dialog.h',
127         'shell/browser/shell_login_dialog_mac.mm',
128         'shell/browser/shell_mac.mm',
129         'shell/browser/shell_message_filter.cc',
130         'shell/browser/shell_message_filter.h',
131         'shell/browser/shell_net_log.cc',
132         'shell/browser/shell_net_log.h',
133         'shell/browser/shell_network_delegate.cc',
134         'shell/browser/shell_network_delegate.h',
135         'shell/browser/shell_notification_manager.cc',
136         'shell/browser/shell_notification_manager.h',
137         'shell/browser/shell_platform_data_aura.cc',
138         'shell/browser/shell_platform_data_aura.h',
139         'shell/browser/shell_plugin_service_filter.cc',
140         'shell/browser/shell_plugin_service_filter.h',
141         'shell/browser/shell_quota_permission_context.cc',
142         'shell/browser/shell_quota_permission_context.h',
143         'shell/browser/shell_resource_dispatcher_host_delegate.cc',
144         'shell/browser/shell_resource_dispatcher_host_delegate.h',
145         'shell/browser/shell_speech_recognition_manager_delegate.cc',
146         'shell/browser/shell_speech_recognition_manager_delegate.h',
147         'shell/browser/shell_url_request_context_getter.cc',
148         'shell/browser/shell_url_request_context_getter.h',
149         'shell/browser/shell_views.cc',
150         'shell/browser/shell_web_contents_view_delegate_android.cc',
151         'shell/browser/shell_web_contents_view_delegate_creator.h',
152         'shell/browser/shell_web_contents_view_delegate.h',
153         'shell/browser/shell_web_contents_view_delegate_mac.mm',
154         'shell/browser/shell_web_contents_view_delegate_win.cc',
155         'shell/browser/webkit_test_controller.cc',
156         'shell/browser/webkit_test_controller.h',
157         'shell/common/leak_detection_result.h',
158         'shell/common/shell_content_client.cc',
159         'shell/common/shell_content_client.h',
160         'shell/common/shell_messages.cc',
161         'shell/common/shell_messages.h',
162         'shell/common/shell_switches.cc',
163         'shell/common/shell_switches.h',
164         'shell/common/shell_test_configuration.cc',
165         'shell/common/shell_test_configuration.h',
166         'shell/common/test_runner/test_preferences.cc',
167         'shell/common/test_runner/test_preferences.h',
168         'shell/common/v8_breakpad_support_win.cc',
169         'shell/common/v8_breakpad_support_win.h',
170         'shell/common/webkit_test_helpers.cc',
171         'shell/common/webkit_test_helpers.h',
172         'shell/geolocation/shell_access_token_store.cc',
173         'shell/geolocation/shell_access_token_store.h',
174         'shell/renderer/gc_controller.cc',
175         'shell/renderer/gc_controller.h',
176         'shell/renderer/ipc_echo.cc',
177         'shell/renderer/ipc_echo.h',
178         'shell/renderer/leak_detector.cc',
179         'shell/renderer/leak_detector.h',
180         'shell/renderer/shell_content_renderer_client.cc',
181         'shell/renderer/shell_content_renderer_client.h',
182         'shell/renderer/shell_render_frame_observer.cc',
183         'shell/renderer/shell_render_frame_observer.h',
184         'shell/renderer/shell_render_process_observer.cc',
185         'shell/renderer/shell_render_process_observer.h',
186         'shell/renderer/shell_render_view_observer.cc',
187         'shell/renderer/shell_render_view_observer.h',
188         'shell/renderer/test_runner/accessibility_controller.cc',
189         'shell/renderer/test_runner/accessibility_controller.h',
190         'shell/renderer/test_runner/event_sender.cc',
191         'shell/renderer/test_runner/event_sender.h',
192         'shell/renderer/test_runner/gamepad_controller.cc',
193         'shell/renderer/test_runner/gamepad_controller.h',
194         'shell/renderer/test_runner/mock_color_chooser.cc',
195         'shell/renderer/test_runner/mock_color_chooser.h',
196         'shell/renderer/test_runner/mock_credential_manager_client.cc',
197         'shell/renderer/test_runner/mock_credential_manager_client.h',
198         'shell/renderer/test_runner/mock_constraints.cc',
199         'shell/renderer/test_runner/mock_constraints.h',
200         'shell/renderer/test_runner/mock_grammar_check.cc',
201         'shell/renderer/test_runner/mock_grammar_check.h',
202         'shell/renderer/test_runner/mock_screen_orientation_client.cc',
203         'shell/renderer/test_runner/mock_screen_orientation_client.h',
204         'shell/renderer/test_runner/mock_spell_check.cc',
205         'shell/renderer/test_runner/mock_spell_check.h',
206         'shell/renderer/test_runner/mock_web_audio_device.cc',
207         'shell/renderer/test_runner/mock_web_audio_device.h',
208         'shell/renderer/test_runner/mock_web_media_stream_center.cc',
209         'shell/renderer/test_runner/mock_web_media_stream_center.h',
210         'shell/renderer/test_runner/mock_web_midi_accessor.cc',
211         'shell/renderer/test_runner/mock_web_midi_accessor.h',
212         'shell/renderer/test_runner/mock_web_push_client.cc',
213         'shell/renderer/test_runner/mock_web_push_client.h',
214         'shell/renderer/test_runner/mock_web_speech_recognizer.cc',
215         'shell/renderer/test_runner/mock_web_speech_recognizer.h',
216         'shell/renderer/test_runner/mock_web_theme_engine.cc',
217         'shell/renderer/test_runner/mock_web_theme_engine.h',
218         'shell/renderer/test_runner/mock_web_theme_engine_mac.h',
219         'shell/renderer/test_runner/mock_web_theme_engine_mac.mm',
220         'shell/renderer/test_runner/mock_web_user_media_client.cc',
221         'shell/renderer/test_runner/mock_web_user_media_client.h',
222         'shell/renderer/test_runner/mock_webrtc_data_channel_handler.cc',
223         'shell/renderer/test_runner/mock_webrtc_data_channel_handler.h',
224         'shell/renderer/test_runner/mock_webrtc_dtmf_sender_handler.cc',
225         'shell/renderer/test_runner/mock_webrtc_dtmf_sender_handler.h',
226         'shell/renderer/test_runner/mock_webrtc_peer_connection_handler.cc',
227         'shell/renderer/test_runner/mock_webrtc_peer_connection_handler.h',
228         'shell/renderer/test_runner/notification_presenter.cc',
229         'shell/renderer/test_runner/notification_presenter.h',
230         'shell/renderer/test_runner/spell_check_client.cc',
231         'shell/renderer/test_runner/spell_check_client.h',
232         'shell/renderer/test_runner/test_common.cc',
233         'shell/renderer/test_runner/test_common.h',
234         'shell/renderer/test_runner/test_interfaces.cc',
235         'shell/renderer/test_runner/test_interfaces.h',
236         'shell/renderer/test_runner/test_plugin.cc',
237         'shell/renderer/test_runner/test_plugin.h',
238         'shell/renderer/test_runner/test_runner.cc',
239         'shell/renderer/test_runner/test_runner.h',
240         'shell/renderer/test_runner/text_input_controller.cc',
241         'shell/renderer/test_runner/text_input_controller.h',
242         'shell/renderer/test_runner/web_ax_object_proxy.cc',
243         'shell/renderer/test_runner/web_ax_object_proxy.h',
244         'shell/renderer/test_runner/web_frame_test_proxy.h',
245         'shell/renderer/test_runner/web_permissions.cc',
246         'shell/renderer/test_runner/web_permissions.h',
247         'shell/renderer/test_runner/web_task.cc',
248         'shell/renderer/test_runner/web_task.h',
249         'shell/renderer/test_runner/web_test_delegate.h',
250         'shell/renderer/test_runner/web_test_interfaces.cc',
251         'shell/renderer/test_runner/web_test_interfaces.h',
252         'shell/renderer/test_runner/web_test_proxy.cc',
253         'shell/renderer/test_runner/web_test_proxy.h',
254         'shell/renderer/test_runner/web_test_runner.h',
255         'shell/renderer/webkit_test_runner.cc',
256         'shell/renderer/webkit_test_runner.h',
257       ],
258       'msvs_settings': {
259         'VCLinkerTool': {
260           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
261         },
262       },
263       'conditions': [
264         ['OS=="win" and win_use_allocator_shim==1', {
265           'dependencies': [
266             '../base/allocator/allocator.gyp:allocator',
267           ],
268         }],
269         ['OS=="win"', {
270           'resource_include_dirs': [
271             '<(SHARED_INTERMEDIATE_DIR)/content/app/strings',
272           ],
273           'dependencies': [
274             '<(DEPTH)/content/app/strings/content_strings.gyp:content_strings',
275           ],
276           'configurations': {
277             'Debug_Base': {
278               'msvs_settings': {
279                 'VCLinkerTool': {
280                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
281                 },
282               },
283             },
284           },
285           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
286           'msvs_disabled_warnings': [ 4267, ],
287         }],  # OS=="win"
288         ['OS=="linux"', {
289           'dependencies': [
290             '../build/linux/system.gyp:fontconfig',
291           ],
292         }],
293         ['use_x11 == 1', {
294           'dependencies': [
295             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
296           ],
297         }],
298         ['OS=="android"', {
299           'dependencies': [
300             'content_shell_jni_headers',
301           ],
302           'dependencies!': [
303             'copy_test_netscape_plugin',
304           ],
305         }],  # OS=="android"
306         ['os_posix == 1 and OS != "mac" and android_webview_build != 1', {
307           'dependencies': [
308             '../components/components.gyp:breakpad_host',
309           ],
310         }],
311         ['(OS=="linux" or OS=="android") and use_allocator!="none"', {
312           'dependencies': [
313             # This is needed by content/app/content_main_runner.cc
314             '../base/allocator/allocator.gyp:allocator',
315           ],
316         }],
317         ['use_aura==1', {
318           'dependencies': [
319             '../ui/aura/aura.gyp:aura',
320             '../ui/aura/aura.gyp:aura_test_support',
321             '../ui/events/events.gyp:events',
322             '../ui/strings/ui_strings.gyp:ui_strings',
323             '../ui/wm/wm.gyp:wm',
324           ],
325           'conditions': [
326             ['toolkit_views==1', {
327               'dependencies': [
328                 '../ui/resources/ui_resources.gyp:ui_resources',
329                 '../ui/views/controls/webview/webview.gyp:webview',
330                 '../ui/views/views.gyp:views',
331                 '../ui/views/views.gyp:views_test_support',
332               ],
333               'sources/': [
334                 ['exclude', 'shell/browser/shell_aura.cc'],
335               ],
336             }, {
337               'sources/': [
338                 ['exclude', 'shell/browser/shell_views.cc'],
339               ],
340             }],
341           ],
342         }, {
343           'sources/': [
344             ['exclude', 'shell/browser/shell_aura.cc'],
345             ['exclude', 'shell/browser/shell_views.cc'],
346           ],
347         }],  # use_aura==1
348         # The test plugin relies on X11.
349         ['OS=="linux" and use_x11==0', {
350           'dependencies!': [
351             'copy_test_netscape_plugin',
352           ],
353         }],
354         ['chromeos==1', {
355           'dependencies': [
356             '../chromeos/chromeos.gyp:chromeos',
357             '../ui/wm/wm.gyp:wm_test_support',
358            ],
359         }], # chromeos==1
360         ['use_custom_freetype==1', {
361           'dependencies': [
362              '../third_party/freetype2/freetype2.gyp:freetype2',
363           ],
364         }],
365         ['enable_plugins==0', {
366           'sources!': [
367             'shell/browser/shell_plugin_service_filter.cc',
368             'shell/browser/shell_plugin_service_filter.h',
369           ],
370         }]
371       ],
372     },
373     {
374       # GN version: //content/shell:resources
375       'target_name': 'content_shell_resources',
376       'type': 'none',
377       'variables': {
378         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/content',
379       },
380       'actions': [
381         {
382           'action_name': 'generate_content_shell_resources',
383           'variables': {
384             'grit_grd_file': 'shell/shell_resources.grd',
385           },
386           'includes': [ '../build/grit_action.gypi' ],
387         },
388       ],
389       'includes': [ '../build/grit_target.gypi' ],
390       'copies': [
391         {
392           'destination': '<(PRODUCT_DIR)',
393           'files': [
394             '<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak'
395           ],
396         },
397       ],
398       'conditions': [
399         ['OS=="win"', {
400           'copies': [{
401             'destination': '<(PRODUCT_DIR)',
402             'files': ['shell/renderer/test_runner/resources/fonts/AHEM____.TTF'],
403           }],
404         }],
405         ['OS=="mac"', {
406           'all_dependent_settings': {
407             'mac_bundle_resources': [
408               'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
409               'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
410               '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
411               '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
412             ],
413           },
414         }],
415         ['use_x11 == 1', {
416           'copies': [{
417             'destination': '<(PRODUCT_DIR)',
418             'files': [
419               'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
420               'shell/renderer/test_runner/resources/fonts/fonts.conf',
421               '../third_party/gardiner_mod/GardinerModBug.ttf',
422               '../third_party/gardiner_mod/GardinerModCat.ttf',
423             ]
424           }],
425         }],
426         ['OS=="android"', {
427           'copies': [{
428             'destination': '<(PRODUCT_DIR)',
429             'files': [
430               'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
431               'shell/renderer/test_runner/resources/fonts/android_main_fonts.xml',
432               'shell/renderer/test_runner/resources/fonts/android_fallback_fonts.xml',
433             ]
434           }],
435         }],
436       ],
437     },
438     {
439       # We build a minimal set of resources so WebKit in content_shell has
440       # access to necessary resources.
441       # GN version: //content/shell:pak
442       'target_name': 'content_shell_pak',
443       'type': 'none',
444       'dependencies': [
445         'app/resources/content_resources.gyp:content_resources',
446         'app/strings/content_strings.gyp:content_strings',
447         'browser/tracing/tracing_resources.gyp:tracing_resources',
448         'content.gyp:content_resources',
449         'content_shell_resources',
450         '<(DEPTH)/net/net.gyp:net_resources',
451         '<(DEPTH)/third_party/WebKit/public/blink_resources.gyp:blink_resources',
452         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
453         '<(DEPTH)/ui/strings/ui_strings.gyp:ui_strings',
454       ],
455       'conditions': [
456         ['OS!="android"', {
457           'dependencies': [
458             'browser/devtools/devtools_resources.gyp:devtools_resources',
459           ],
460         }],
461         ['OS=="android"', {
462           'copies': [
463             {
464               'destination': '<(PRODUCT_DIR)',
465               'files': [
466                 '<(PRODUCT_DIR)/content_shell/assets/content_shell.pak'
467               ],
468             },
469           ],
470         }],
471       ],
472       'actions': [
473         {
474           'action_name': 'repack_content_shell_pack',
475           'variables': {
476             'pak_inputs': [
477               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
478               '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
479               '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak',
480               '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.pak',
481               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
482               '<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak',
483               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
484               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
485               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
486               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
487               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
488             ],
489             'conditions': [
490               ['OS!="android"', {
491                 'pak_inputs': ['<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',],
492                 'pak_output': '<(PRODUCT_DIR)/content_shell.pak',
493               }, {
494                 'pak_output': '<(PRODUCT_DIR)/content_shell/assets/content_shell.pak',
495               }],
496             ],
497           },
498           'includes': [ '../build/repack_action.gypi' ],
499         },
500       ],
501     },
502     {
503       # GN version: //content/shell:content_shell
504       'target_name': 'content_shell',
505       'type': 'executable',
506       'mac_bundle': 1,
507       'variables': {
508         'chromium_code': 1,
509       },
510       'dependencies': [
511         'content_shell_lib',
512         'content_shell_pak',
513         '../third_party/mesa/mesa.gyp:osmesa',
514         '../tools/imagediff/image_diff.gyp:image_diff',
515       ],
516       'include_dirs': [
517         '..',
518       ],
519       'sources': [
520         'shell/app/shell_main.cc',
521       ],
522       'mac_bundle_resources': [
523         'shell/app/app.icns',
524         'shell/app/app-Info.plist',
525       ],
526       # TODO(mark): Come up with a fancier way to do this.  It should only
527       # be necessary to list app-Info.plist once, not the three times it is
528       # listed here.
529       'mac_bundle_resources!': [
530         'shell/app/app-Info.plist',
531       ],
532       'xcode_settings': {
533         'INFOPLIST_FILE': 'shell/app/app-Info.plist',
534       },
535       'msvs_settings': {
536         'VCManifestTool': {
537           'AdditionalManifestFiles': [
538             'shell/app/shell.exe.manifest',
539           ],
540         },
541       },
542       'conditions': [
543         ['OS=="win" and win_use_allocator_shim==1', {
544           'dependencies': [
545             '../base/allocator/allocator.gyp:allocator',
546           ],
547         }],
548         ['OS=="win"', {
549           'sources': [
550             'shell/app/shell.rc',
551           ],
552           'configurations': {
553             'Debug_Base': {
554               'msvs_settings': {
555                 'VCLinkerTool': {
556                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
557                 },
558               },
559             },
560           },
561         }],  # OS=="win"
562         ['OS == "win"', {
563           'dependencies': [
564             '../sandbox/sandbox.gyp:sandbox',
565           ],
566         }],  # OS=="win"
567         ['OS=="win" and asan==0', {
568           'msvs_settings': {
569             'VCLinkerTool': {
570               'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
571             },
572           },
573         }],  # OS=="win" and asan==0
574         ['OS=="mac"', {
575           'product_name': '<(content_shell_product_name)',
576           'dependencies!': [
577             'content_shell_lib',
578           ],
579           'dependencies': [
580             'content_shell_framework',
581             'content_shell_helper_app',
582           ],
583           'copies': [
584             {
585               'destination': '<(PRODUCT_DIR)/<(content_shell_product_name).app/Contents/Frameworks',
586               'files': [
587                 '<(PRODUCT_DIR)/<(content_shell_product_name) Helper.app',
588               ],
589             },
590           ],
591           'postbuilds': [
592             {
593               'postbuild_name': 'Copy <(content_shell_product_name) Framework.framework',
594               'action': [
595                 '../build/mac/copy_framework_unversioned.sh',
596                 '${BUILT_PRODUCTS_DIR}/<(content_shell_product_name) Framework.framework',
597                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Frameworks',
598               ],
599             },
600             {
601               # Modify the Info.plist as needed.
602               'postbuild_name': 'Tweak Info.plist',
603               'action': ['../build/mac/tweak_info_plist.py',
604                          '--scm=1',
605                          '--version=<(content_shell_version)'],
606             },
607             {
608               # This postbuid step is responsible for creating the following
609               # helpers:
610               #
611               # Content Shell Helper EH.app and Content Shell Helper NP.app are
612               # created from Content Shell Helper.app.
613               #
614               # The EH helper is marked for an executable heap. The NP helper
615               # is marked for no PIE (ASLR).
616               'postbuild_name': 'Make More Helpers',
617               'action': [
618                 '../build/mac/make_more_helpers.sh',
619                 'Frameworks',
620                 '<(content_shell_product_name)',
621               ],
622             },
623             {
624               # Make sure there isn't any Objective-C in the shell's
625               # executable.
626               'postbuild_name': 'Verify No Objective-C',
627               'action': [
628                 '../build/mac/verify_no_objc.sh',
629               ],
630             },
631           ],
632         }],  # OS=="mac"
633         ['OS=="android"', {
634           'dependencies!': [
635             '../tools/imagediff/image_diff.gyp:image_diff',
636           ],
637         }],  # OS=="android"
638         ['OS=="android" and android_webview_build==0', {
639           'dependencies': [
640             '../tools/imagediff/image_diff.gyp:image_diff#host',
641           ],
642         }],  # OS=="android" and android_webview_build==0
643       ],
644     },
645     {
646       'target_name': 'content_shell_builder',
647       'type': 'none',
648       'dependencies': [
649         'content_shell',
650       ],
651     },
653     {
654       'target_name': 'test_netscape_plugin',
655       'type': 'loadable_module',
656       'sources': [
657         'shell/tools/plugin/PluginObject.cpp',
658         'shell/tools/plugin/PluginObject.h',
659         'shell/tools/plugin/PluginObjectMac.mm',
660         'shell/tools/plugin/PluginTest.cpp',
661         'shell/tools/plugin/PluginTest.h',
662         'shell/tools/plugin/TestObject.cpp',
663         'shell/tools/plugin/Tests/DocumentOpenInDestroyStream.cpp',
664         'shell/tools/plugin/Tests/EvaluateJSAfterRemovingPluginElement.cpp',
665         'shell/tools/plugin/Tests/FormValue.cpp',
666         'shell/tools/plugin/Tests/GetURLNotifyWithURLThatFailsToLoad.cpp',
667         'shell/tools/plugin/Tests/GetURLWithJavaScriptURL.cpp',
668         'shell/tools/plugin/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp',
669         'shell/tools/plugin/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp',
670         'shell/tools/plugin/Tests/LeakWindowScriptableObject.cpp',
671         'shell/tools/plugin/Tests/LogNPPSetWindow.cpp',
672         'shell/tools/plugin/Tests/NPDeallocateCalledBeforeNPShutdown.cpp',
673         'shell/tools/plugin/Tests/NPPNewFails.cpp',
674         'shell/tools/plugin/Tests/NPRuntimeCallsWithNullNPP.cpp',
675         'shell/tools/plugin/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp',
676         'shell/tools/plugin/Tests/NPRuntimeRemoveProperty.cpp',
677         'shell/tools/plugin/Tests/NullNPPGetValuePointer.cpp',
678         'shell/tools/plugin/Tests/PassDifferentNPPStruct.cpp',
679         'shell/tools/plugin/Tests/PluginScriptableNPObjectInvokeDefault.cpp',
680         'shell/tools/plugin/Tests/PluginScriptableObjectOverridesAllProperties.cpp',
681         'shell/tools/plugin/main.cpp',
682         'shell/tools/plugin/test_object.h',
683       ],
684       'include_dirs': [
685         '<(DEPTH)',
686         '<(DEPTH)/content/shell/tools/plugin/',
687       ],
688       'dependencies': [
689         '../base/base.gyp:base',
690         '../third_party/npapi/npapi.gyp:npapi',
691       ],
692       'conditions': [
693         ['OS=="mac"', {
694           'mac_bundle': 1,
695           'product_extension': 'plugin',
696           'link_settings': {
697             'libraries': [
698               '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
699               '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
700               '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
701             ]
702           },
703           'xcode_settings': {
704             'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
705             'INFOPLIST_FILE': 'shell/tools/plugin/mac/Info.plist',
706           },
707         }],
708         ['os_posix == 1 and OS != "mac"', {
709           'cflags': [
710             '-fvisibility=default',
711           ],
712         }],
713         ['OS=="win"', {
714           'defines': [
715             # This seems like a hack, but this is what Safari Win does.
716             'snprintf=_snprintf',
717           ],
718           'sources': [
719             'shell/tools/plugin/win/TestNetscapePlugin.def',
720             'shell/tools/plugin/win/TestNetscapePlugin.rc',
721           ],
722           # The .rc file requires that the name of the dll is np_test_netscape_plugin.dll.
723           'product_name': 'np_test_netscape_plugin',
724           # Disable c4267 warnings until we fix size_t to int truncations.
725           'msvs_disabled_warnings': [ 4267, ],
726         }],
727       ],
728     },
729     {
730       'target_name': 'copy_test_netscape_plugin',
731       'type': 'none',
732       'dependencies': [
733         'test_netscape_plugin',
734       ],
735       'conditions': [
736         ['OS=="win"', {
737           'copies': [{
738             'destination': '<(PRODUCT_DIR)/plugins',
739             'files': ['<(PRODUCT_DIR)/np_test_netscape_plugin.dll'],
740           }],
741         }],
742         ['OS=="mac"', {
743           'copies': [{
744             'destination': '<(PRODUCT_DIR)/plugins/',
745             'files': ['<(PRODUCT_DIR)/test_netscape_plugin.plugin/'],
746           }],
747         }],
748         ['os_posix == 1 and OS != "mac"', {
749           'copies': [{
750             'destination': '<(PRODUCT_DIR)/plugins',
751             'files': ['<(PRODUCT_DIR)/libtest_netscape_plugin.so'],
752           }],
753         }],
754       ],
755     }
756   ],
757   'conditions': [
758     ['OS=="mac" or OS=="win"', {
759       'targets': [
760         {
761           'target_name': 'layout_test_helper',
762           'type': 'executable',
763           'sources': [
764             'shell/renderer/test_runner/helper/layout_test_helper_mac.mm',
765             'shell/renderer/test_runner/helper/layout_test_helper_win.cc',
766           ],
767           'conditions': [
768             ['OS=="mac"', {
769               'link_settings': {
770                 'libraries': [
771                   '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
772                 ],
773               },
774             }],
775           ],
776         },
777       ],
778     }],  # OS=="mac" or OS=="win"
779     ['OS=="mac"', {
780       'targets': [
781         {
782           'target_name': 'content_shell_framework',
783           'type': 'shared_library',
784           'product_name': '<(content_shell_product_name) Framework',
785           'mac_bundle': 1,
786           'mac_bundle_resources': [
787             'shell/app/English.lproj/HttpAuth.xib',
788             'shell/app/English.lproj/MainMenu.xib',
789             '<(PRODUCT_DIR)/content_shell.pak',
790             'shell/app/framework-Info.plist',
791           ],
792           'mac_bundle_resources!': [
793             'shell/app/framework-Info.plist',
794           ],
795           'xcode_settings': {
796             # The framework is placed within the .app's Framework
797             # directory.  DYLIB_INSTALL_NAME_BASE and
798             # LD_DYLIB_INSTALL_NAME affect -install_name.
799             'DYLIB_INSTALL_NAME_BASE':
800                 '@executable_path/../Frameworks',
801             # See /build/mac/copy_framework_unversioned.sh for
802             # information on LD_DYLIB_INSTALL_NAME.
803             'LD_DYLIB_INSTALL_NAME':
804                 '$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(WRAPPER_NAME)/$(PRODUCT_NAME)',
806             'INFOPLIST_FILE': 'shell/app/framework-Info.plist',
807           },
808           'dependencies': [
809             'content_shell_lib',
810           ],
811           'include_dirs': [
812             '..',
813           ],
814           'sources': [
815             'shell/app/shell_content_main.cc',
816             'shell/app/shell_content_main.h',
817           ],
818           'postbuilds': [
819             {
820               # Modify the Info.plist as needed.  The script explains why
821               # this is needed.  This is also done in the chrome target.
822               # The framework needs the Breakpad keys if this feature is
823               # enabled.  It does not need the Keystone keys; these always
824               # come from the outer application bundle.  The framework
825               # doesn't currently use the SCM keys for anything,
826               # but this seems like a really good place to store them.
827               'postbuild_name': 'Tweak Info.plist',
828               'action': ['../build/mac/tweak_info_plist.py',
829                          '--breakpad=1',
830                          '--keystone=0',
831                          '--scm=1',
832                          '--version=<(content_shell_version)',
833                          '--branding=<(content_shell_product_name)'],
834             },
835           ],
836           'copies': [
837             {
838               # Copy FFmpeg binaries for audio/video support.
839               'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
840               'files': [
841                 '<(PRODUCT_DIR)/ffmpegsumo.so',
842               ],
843             },
844             {
845               'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Resources',
846               'files': [
847                 '<(PRODUCT_DIR)/crash_inspector',
848                 '<(PRODUCT_DIR)/crash_report_sender.app'
849               ],
850             },
851           ],
852           'conditions': [
853             ['enable_webrtc==1', {
854               'variables': {
855                 'libpeer_target_type%': 'static_library',
856               },
857               'conditions': [
858                 ['libpeer_target_type!="static_library"', {
859                   'copies': [{
860                    'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
861                    'files': [
862                       '<(PRODUCT_DIR)/libpeerconnection.so',
863                     ],
864                   }],
865                 }],
866               ],
867             }],
868             ['icu_use_data_file_flag==1', {
869               'mac_bundle_resources': [
870                 '<(PRODUCT_DIR)/icudtl.dat',
871               ],
872             }],
873           ],
874         },  # target content_shell_framework
875         {
876           'target_name': 'content_shell_helper_app',
877           'type': 'executable',
878           'variables': { 'enable_wexit_time_destructors': 1, },
879           'product_name': '<(content_shell_product_name) Helper',
880           'mac_bundle': 1,
881           'dependencies': [
882             'content_shell_framework',
883           ],
884           'sources': [
885             'shell/app/shell_main.cc',
886             'shell/app/helper-Info.plist',
887           ],
888           # TODO(mark): Come up with a fancier way to do this.  It should only
889           # be necessary to list helper-Info.plist once, not the three times it
890           # is listed here.
891           'mac_bundle_resources!': [
892             'shell/app/helper-Info.plist',
893           ],
894           # TODO(mark): For now, don't put any resources into this app.  Its
895           # resources directory will be a symbolic link to the browser app's
896           # resources directory.
897           'mac_bundle_resources/': [
898             ['exclude', '.*'],
899           ],
900           'xcode_settings': {
901             'INFOPLIST_FILE': 'shell/app/helper-Info.plist',
902           },
903           'postbuilds': [
904             {
905               # The framework defines its load-time path
906               # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
907               # (chrome).  A different relative path needs to be used in
908               # content_shell_helper_app.
909               'postbuild_name': 'Fix Framework Link',
910               'action': [
911                 'install_name_tool',
912                 '-change',
913                 '@executable_path/../Frameworks/<(content_shell_product_name) Framework.framework/<(content_shell_product_name) Framework',
914                 '@executable_path/../../../<(content_shell_product_name) Framework.framework/<(content_shell_product_name) Framework',
915                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
916               ],
917             },
918             {
919               # Modify the Info.plist as needed.  The script explains why this
920               # is needed.  This is also done in the chrome and chrome_dll
921               # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
922               # are used because Breakpad, Keystone, and SCM keys are
923               # never placed into the helper.
924               'postbuild_name': 'Tweak Info.plist',
925               'action': ['../build/mac/tweak_info_plist.py',
926                          '--breakpad=0',
927                          '--keystone=0',
928                          '--scm=0',
929                          '--version=<(content_shell_version)'],
930             },
931             {
932               # Make sure there isn't any Objective-C in the helper app's
933               # executable.
934               'postbuild_name': 'Verify No Objective-C',
935               'action': [
936                 '../build/mac/verify_no_objc.sh',
937               ],
938             },
939           ],
940           'conditions': [
941             ['component=="shared_library"', {
942               'xcode_settings': {
943                 'LD_RUNPATH_SEARCH_PATHS': [
944                   # Get back from Content Shell.app/Contents/Frameworks/
945                   #                                 Helper.app/Contents/MacOS
946                   '@loader_path/../../../../../..',
947                 ],
948               },
949             }],
950           ],
951         },  # target content_shell_helper_app
952       ],
953     }],  # OS=="mac"
954     ['OS=="android"', {
955       'targets': [
956         {
957           # TODO(jrg): Update this action and other jni generators to only
958           # require specifying the java directory and generate the rest.
959           'target_name': 'content_shell_jni_headers',
960           'type': 'none',
961           'sources': [
962             'shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java',
963             'shell/android/java/src/org/chromium/content_shell/ShellLayoutTestUtils.java',
964             'shell/android/java/src/org/chromium/content_shell/ShellManager.java',
965             'shell/android/java/src/org/chromium/content_shell/Shell.java',
966           ],
967           'variables': {
968             'jni_gen_package': 'content/shell',
969           },
970           'includes': [ '../build/jni_generator.gypi' ],
971         },
972         {
973           'target_name': 'libcontent_shell_content_view',
974           'type': 'shared_library',
975           'dependencies': [
976             'content_shell_jni_headers',
977             'content_shell_lib',
978             'content_shell_pak',
979             # Skia is necessary to ensure the dependencies needed by
980             # WebContents are included.
981             '../skia/skia.gyp:skia',
982             '<(DEPTH)/media/media.gyp:player_android',
983           ],
984           'sources': [
985             'shell/android/shell_library_loader.cc',
986             'shell/android/shell_library_loader.h',
987           ],
988           'conditions': [
989             ['android_webview_build==1', {
990               'ldflags': [
991                 '-lgabi++',  # For rtti
992               ],
993             }],
994           ],
995         },
996         {
997           'target_name': 'content_shell_java',
998           'type': 'none',
999           'dependencies': [
1000             'content.gyp:content_java',
1001           ],
1002           'variables': {
1003             'java_in_dir': '../content/shell/android/java',
1004             'has_java_resources': 1,
1005             'R_package': 'org.chromium.content_shell',
1006             'R_package_relpath': 'org/chromium/content_shell',
1007           },
1008           'includes': [ '../build/java.gypi' ],
1009         },
1010         {
1011           # content_shell_apk creates a .jar as a side effect. Any java targets
1012           # that need that .jar in their classpath should depend on this target,
1013           # content_shell_apk_java. Dependents of content_shell_apk receive its
1014           # jar path in the variable 'apk_output_jar_path'. This target should
1015           # only be used by targets which instrument content_shell_apk.
1016           'target_name': 'content_shell_apk_java',
1017           'type': 'none',
1018           'dependencies': [
1019             'content_shell_apk',
1020           ],
1021           'includes': [ '../build/apk_fake_jar.gypi' ],
1022         },
1023         {
1024           'target_name': 'content_shell_apk',
1025           'type': 'none',
1026           'dependencies': [
1027             'content.gyp:content_icudata',
1028             'content.gyp:content_java',
1029             'content_java_test_support',
1030             'content_shell_java',
1031             'libcontent_shell_content_view',
1032             '../base/base.gyp:base_java',
1033             '../media/media.gyp:media_java',
1034             '../net/net.gyp:net_java',
1035             '../third_party/mesa/mesa.gyp:osmesa_in_lib_dir',
1036             '../tools/android/forwarder/forwarder.gyp:forwarder',
1037             '../ui/android/ui_android.gyp:ui_java',
1038           ],
1039           'variables': {
1040             'apk_name': 'ContentShell',
1041             'manifest_package_name': 'org.chromium.content_shell_apk',
1042             'java_in_dir': 'shell/android/shell_apk',
1043             'resource_dir': 'shell/android/shell_apk/res',
1044             'native_lib_target': 'libcontent_shell_content_view',
1045             'additional_input_paths': ['<(PRODUCT_DIR)/content_shell/assets/content_shell.pak'],
1046             'asset_location': '<(PRODUCT_DIR)/content_shell/assets',
1047             'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
1048             'conditions': [
1049               ['icu_use_data_file_flag==1', {
1050                 'additional_input_paths': [
1051                   '<(PRODUCT_DIR)/icudtl.dat',
1052                 ],
1053               }],
1054             ],
1055           },
1056           'conditions': [
1057             ['android_webview_build==0', {
1058               'dependencies': [
1059                 '../tools/imagediff/image_diff.gyp:image_diff#host',
1060               ],
1061             }],
1062           ],
1063           'includes': [ '../build/java_apk.gypi' ],
1064         },
1065       ],
1066     }],  # OS=="android"
1067     ['OS=="win"', {
1068       'targets': [
1069         {
1070           'target_name': 'content_shell_crash_service',
1071           'type': 'executable',
1072           'dependencies': [
1073             '../base/base.gyp:base',
1074             '../components/components.gyp:breakpad_crash_service',
1075           ],
1076           'include_dirs': [
1077             '..',
1078           ],
1079           'sources': [
1080             'shell/tools/content_shell_crash_service.cc',
1081           ],
1082           'msvs_settings': {
1083             'VCLinkerTool': {
1084               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
1085             },
1086           },
1087         },
1088       ],
1089     }],  # OS=="win"
1090     ['OS=="win" and fastbuild==0 and target_arch=="ia32" and syzyasan==1', {
1091       'variables': {
1092         'dest_dir': '<(PRODUCT_DIR)/syzygy',
1093       },
1094       'targets': [
1095         {
1096           'target_name': 'content_shell_syzyasan',
1097           'type': 'none',
1098           'sources' : [],
1099           # Instrument content_shell with SyzyAsan.
1100           'actions': [
1101             {
1102               'action_name': 'Instrument content_shell with SyzyAsan',
1103               'inputs': [
1104                 '<(PRODUCT_DIR)/content_shell.exe',
1105               ],
1106               'outputs': [
1107                 '<(dest_dir)/content_shell.exe',
1108                 '<(dest_dir)/content_shell.exe.pdb',
1109               ],
1110               'action': [
1111                 'python',
1112                 '<(DEPTH)/chrome/tools/build/win/syzygy_instrument.py',
1113                 '--mode', 'asan',
1114                 '--input_executable', '<(PRODUCT_DIR)/content_shell.exe',
1115                 '--input_symbol', '<(PRODUCT_DIR)/content_shell.exe.pdb',
1116                 '--destination_dir', '<(dest_dir)',
1117               ],
1118             },
1119           ],
1120         },
1121       ],
1122     }],  # OS=="win" and fastbuild==0 and target_arch=="ia32"
1123   ]