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