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