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