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