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