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