Roll src/third_party/skia 2469c99:48c3534
[chromium-blink-merge.git] / chromecast / chromecast.gyp
blob7702c10897ec69bbafe2ac7acd162d7eff47b54e
1 # Copyright 2014 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     'android_support_v13_target%':
8         '../third_party/android_tools/android_tools.gyp:android_support_v13_javalib',
9     'cast_build_release': 'internal/build/cast_build_release',
10     'chromium_code': 1,
11     'chromecast_branding%': 'Chromium',
12     'disable_display%': 0,
13     'use_chromecast_webui%': 0,
14   },
15   'includes': [
16     'chromecast_tests.gypi',
17   ],
18   'target_defaults': {
19     'include_dirs': [
20       '..',  # Root of Chromium checkout
21     ],
22     'conditions': [
23       ['disable_display==1', {
24         'defines': ['DISABLE_DISPLAY'],
25       }],
26     ],
27   },
28   'targets': [
29     # Public API target for OEM partners to replace shlibs.
30     {
31       'target_name': 'cast_public_api',
32       'type': '<(component)',
33       'sources': [
34         'public/chromecast_export.h',
35       ],
36     },
37     # TODO(gunsch): Remove this fake target once it's either added or no
38     # longer referenced from internal code.
39     {'target_name': 'cast_media_audio', 'type': 'none'},
41     {
42       'target_name': 'cast_base',
43       'type': '<(component)',
44       'dependencies': [
45         '../base/base.gyp:base',
46       ],
47       'sources': [
48         'base/cast_paths.cc',
49         'base/cast_paths.h',
50         'base/metrics/cast_histograms.h',
51         'base/metrics/cast_metrics_helper.cc',
52         'base/metrics/cast_metrics_helper.h',
53         'base/metrics/grouped_histogram.cc',
54         'base/metrics/grouped_histogram.h'
55       ],
56     },  # end of target 'cast_base'
57     {
58       'target_name': 'cast_crash_client',
59       'type': '<(component)',
60       'dependencies': [
61         '../breakpad/breakpad.gyp:breakpad_client',
62         '../components/components.gyp:crash_component',
63       ],
64       'sources': [
65         'crash/cast_crash_keys.cc',
66         'crash/cast_crash_keys.h',
67         'crash/cast_crash_reporter_client.cc',
68         'crash/cast_crash_reporter_client.h',
69       ],
70       'conditions': [
71         ['chromecast_branding=="Chrome"', {
72           'dependencies': [
73             'internal/chromecast_internal.gyp:crash_internal',
74           ],
75         }, {
76           'sources': [
77             'crash/cast_crash_reporter_client_simple.cc',
78           ],
79         }],
80       ]
81     },  # end of target 'cast_crash_client'
82     {
83       'target_name': 'cast_net',
84       'type': '<(component)',
85       'sources': [
86         'net/connectivity_checker.cc',
87         'net/connectivity_checker.h',
88         'net/net_switches.cc',
89         'net/net_switches.h',
90       ],
91     },
92     {
93       'target_name': 'cast_ozone',
94       'type': '<(component)',
95       'sources': [
96         'ozone/gpu_platform_support_cast.cc',
97         'ozone/gpu_platform_support_cast.h',
98         'ozone/ozone_platform_cast.cc',
99         'ozone/ozone_platform_cast.h',
100         'ozone/platform_window_cast.cc',
101         'ozone/platform_window_cast.h',
102         'ozone/surface_factory_cast.cc',
103         'ozone/surface_factory_cast.h',
104         'ozone/surface_ozone_egl_cast.cc',
105         'ozone/surface_ozone_egl_cast.h',
106       ],
107     },
108     {
109       'target_name': 'cast_shell_resources',
110       'type': 'none',
111       'variables': {
112         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chromecast',
113       },
114       'actions': [
115         {
116           'action_name': 'cast_shell_resources',
117           'variables': {
118             'grit_grd_file': 'app/resources/shell_resources.grd',
119             'grit_resource_ids': 'app/resources/resource_ids',
120           },
121           'includes': [ '../build/grit_action.gypi' ],
122         },
123       ],
124       'includes': [ '../build/grit_target.gypi' ],
125     },
126     {
127       'target_name': 'cast_shell_pak',
128       'type': 'none',
129       'dependencies': [
130         'cast_shell_resources',
131         '../content/app/resources/content_resources.gyp:content_resources',
132         '../content/app/strings/content_strings.gyp:content_strings',
133         '../net/net.gyp:net_resources',
134         '../third_party/WebKit/public/blink_resources.gyp:blink_resources',
135         '../ui/resources/ui_resources.gyp:ui_resources',
136         '../ui/strings/ui_strings.gyp:ui_strings',
137       ],
138       'actions': [
139         {
140           'action_name': 'repack_cast_shell_pak',
141           'variables': {
142             'pak_inputs': [
143               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources_100_percent.pak',
144               '<(SHARED_INTERMEDIATE_DIR)/chromecast/shell_resources.pak',
145               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
146               '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
147               '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak',
148               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
149               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
150               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
151               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
152               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
153             ],
154             'conditions': [
155               ['chromecast_branding=="Chrome" and use_chromecast_webui==1', {
156                 'pak_inputs': [
157                   '<(SHARED_INTERMEDIATE_DIR)/chromecast/app_resources.pak',
158                   '<(SHARED_INTERMEDIATE_DIR)/chromecast/cast_webui_resources.pak',
159                 ],
160               }],
161             ],
162             'pak_output': '<(PRODUCT_DIR)/assets/cast_shell.pak',
163           },
164           'includes': [ '../build/repack_action.gypi' ],
165         },
166       ],
167       'conditions': [
168         ['chromecast_branding=="Chrome" and use_chromecast_webui==1', {
169           'dependencies': [
170             'internal/chromecast_resources.gyp:chromecast_app_resources',
171             'internal/chromecast_resources.gyp:chromecast_webui_resources',
172           ],
173         }],
174       ],
175     },  # end of target 'cast_shell_pak'
176     # This target contains all content-embedder implementation that is
177     # non-platform-specific.
178     {
179       'target_name': 'cast_shell_common',
180       'type': '<(component)',
181       'dependencies': [
182         'cast_base',
183         'cast_crash_client',
184         'cast_net',
185         'cast_shell_pak',
186         'cast_shell_resources',
187         'cast_version_header',
188         'chromecast_locales.gyp:chromecast_locales_pak',
189         'chromecast_locales.gyp:chromecast_settings',
190         'media/media.gyp:media_base',
191         '../base/base.gyp:base',
192         '../components/components.gyp:breakpad_host',
193         '../components/components.gyp:cdm_renderer',
194         '../components/components.gyp:component_metrics_proto',
195         '../components/components.gyp:crash_component',
196         '../components/components.gyp:network_hints_browser',
197         '../components/components.gyp:network_hints_renderer',
198         '../components/components.gyp:metrics',
199         '../components/components.gyp:metrics_gpu',
200         '../components/components.gyp:metrics_net',
201         '../components/components.gyp:metrics_profiler',
202         '../content/content.gyp:content',
203         '../content/content.gyp:content_app_both',
204         '../skia/skia.gyp:skia',
205         '../third_party/WebKit/public/blink.gyp:blink',
206         '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
207       ],
208       'sources': [
209         'app/cast_main_delegate.cc',
210         'app/cast_main_delegate.h',
211         'browser/cast_browser_context.cc',
212         'browser/cast_browser_context.h',
213         'browser/cast_browser_main_parts.cc',
214         'browser/cast_browser_main_parts.h',
215         'browser/cast_browser_process.cc',
216         'browser/cast_browser_process.h',
217         'browser/cast_content_browser_client.cc',
218         'browser/cast_content_browser_client.h',
219         'browser/cast_content_window.cc',
220         'browser/cast_content_window.h',
221         'browser/cast_download_manager_delegate.cc',
222         'browser/cast_download_manager_delegate.h',
223         'browser/cast_http_user_agent_settings.cc',
224         'browser/cast_http_user_agent_settings.h',
225         'browser/cast_network_delegate.cc',
226         'browser/cast_network_delegate.h',
227         'browser/cast_permission_manager.cc',
228         'browser/cast_permission_manager.h',
229         'browser/cast_resource_dispatcher_host_delegate.cc',
230         'browser/cast_resource_dispatcher_host_delegate.h',
231         'browser/devtools/cast_dev_tools_delegate.cc',
232         'browser/devtools/cast_dev_tools_delegate.h',
233         'browser/devtools/remote_debugging_server.cc',
234         'browser/devtools/remote_debugging_server.h',
235         'browser/geolocation/cast_access_token_store.cc',
236         'browser/geolocation/cast_access_token_store.h',
237         'browser/metrics/cast_metrics_prefs.cc',
238         'browser/metrics/cast_metrics_prefs.h',
239         'browser/metrics/cast_metrics_service_client.cc',
240         'browser/metrics/cast_metrics_service_client.h',
241         'browser/metrics/cast_stability_metrics_provider.cc',
242         'browser/metrics/cast_stability_metrics_provider.h',
243         'browser/metrics/platform_metrics_providers.h',
244         'browser/pref_service_helper.cc',
245         'browser/pref_service_helper.h',
246         'browser/service/cast_service.cc',
247         'browser/service/cast_service.h',
248         'browser/url_request_context_factory.cc',
249         'browser/url_request_context_factory.h',
250         'common/cast_content_client.cc',
251         'common/cast_content_client.h',
252         'common/cast_resource_delegate.cc',
253         'common/cast_resource_delegate.h',
254         'common/chromecast_switches.cc',
255         'common/chromecast_switches.h',
256         'common/media/cast_messages.h',
257         'common/media/cast_message_generator.cc',
258         'common/media/cast_message_generator.h',
259         'common/platform_client_auth.h',
260         'common/pref_names.cc',
261         'common/pref_names.h',
262         'renderer/cast_content_renderer_client.cc',
263         'renderer/cast_content_renderer_client.h',
264         'renderer/cast_media_load_deferrer.cc',
265         'renderer/cast_media_load_deferrer.h',
266         'renderer/cast_render_process_observer.cc',
267         'renderer/cast_render_process_observer.h',
268         'renderer/key_systems_cast.cc',
269         'renderer/key_systems_cast.h',
270         'renderer/media/capabilities_message_filter.cc',
271         'renderer/media/capabilities_message_filter.h',
272       ],
273       'conditions': [
274         ['chromecast_branding=="Chrome"', {
275           'dependencies': [
276             'internal/chromecast_internal.gyp:cast_shell_internal',
277           ],
278         }, {
279           'sources': [
280             'browser/cast_content_browser_client_simple.cc',
281             'browser/cast_network_delegate_simple.cc',
282             'browser/devtools/remote_debugging_server_simple.cc',
283             'browser/media/cast_browser_cdm_factory_simple.cc',
284             'browser/metrics/platform_metrics_providers_simple.cc',
285             'browser/pref_service_helper_simple.cc',
286             'common/platform_client_auth_simple.cc',
287             'renderer/cast_content_renderer_client_simple.cc',
288             'renderer/key_systems_cast_simple.cc',
289           ],
290           'conditions': [
291             ['OS=="android"', {
292               'sources': [
293                 'browser/service/cast_service_android.cc',
294                 'browser/service/cast_service_android.h',
295               ],
296             }, {
297               'sources': [
298                 'browser/service/cast_service_simple.cc',
299                 'browser/service/cast_service_simple.h',
300               ],
301             }],
302           ],
303         }],
304         # ExternalMetrics not necessary on Android and (as of this writing) uses
305         # non-portable filesystem operations. Also webcrypto is not used on
306         # Android either.
307         ['OS=="linux"', {
308           'sources': [
309             'browser/metrics/external_metrics.cc',
310             'browser/metrics/external_metrics.h',
311           ],
312           'dependencies': [
313             '../components/components.gyp:metrics_serialization',
314           ],
315         }],
316       ],
317     },
318     {
319       'target_name': 'cast_version_header',
320       'type': 'none',
321       'direct_dependent_settings': {
322         'include_dirs': [
323           '<(SHARED_INTERMEDIATE_DIR)',
324         ],
325       },
326       'actions': [
327         {
328           'action_name': 'version_header',
329           'message': 'Generating version header file: <@(_outputs)',
330           'inputs': [
331             '<(version_path)',
332             'common/version.h.in',
333           ],
334           'outputs': [
335             '<(SHARED_INTERMEDIATE_DIR)/chromecast/common/version.h',
336           ],
337           'action': [
338             'python',
339             '<(version_py_path)',
340             '-e', 'VERSION_FULL="<(version_full)"',
341             # CAST_BUILD_INCREMENTAL is taken from buildbot if available;
342             # otherwise, a dev string is used.
343             '-e', 'CAST_BUILD_INCREMENTAL="<!(echo ${CAST_BUILD_INCREMENTAL:="<!(date +%Y%m%d.%H%M%S)"})"',
344             # CAST_BUILD_RELEASE is taken from cast_build_release file if exist;
345             # otherwise, a dev string is used.
346             '-e', 'CAST_BUILD_RELEASE="<!(if test -f <(cast_build_release); then cat <(cast_build_release); else echo eng.${USER}; fi)"',
347             '-e', 'CAST_IS_DEBUG_BUILD=1 if "<(CONFIGURATION_NAME)" == "Debug" else 0',
348             'common/version.h.in',
349             '<@(_outputs)',
350           ],
351           'includes': [
352             '../build/util/version.gypi',
353           ],
354         },
355       ],
356     },
357   ],  # end of targets
359   # Targets for Android receiver.
360   'conditions': [
361     ['OS=="android"', {
362       'targets': [
363         {
364           'target_name': 'cast_shell_icudata',
365           'type': 'none',
366           'dependencies': [
367             '../third_party/icu/icu.gyp:icudata',
368           ],
369           'copies': [{
370             'destination': '<(PRODUCT_DIR)/assets',
371             'files': ['<(PRODUCT_DIR)/icudtl.dat'],
372           }],
373         },
374         {
375           'target_name': 'libcast_shell_android',
376           'type': 'shared_library',
377           'dependencies': [
378             'cast_jni_headers',
379             'cast_shell_common',
380             'cast_shell_icudata',
381             'cast_shell_pak',
382             'cast_version_header',
383             '../base/base.gyp:base',
384             '../breakpad/breakpad.gyp:breakpad_client',
385             '../components/components.gyp:breakpad_host',
386             '../components/components.gyp:crash_component',
387             '../content/content.gyp:content',
388             '../skia/skia.gyp:skia',
389             '../ui/gfx/gfx.gyp:gfx',
390             '../ui/gl/gl.gyp:gl',
391           ],
392           'include_dirs': [
393             '../breakpad/src',
394           ],
395           'sources': [
396             'android/cast_jni_registrar.cc',
397             'android/cast_jni_registrar.h',
398             'android/chromecast_config_android.cc',
399             'android/chromecast_config_android.h',
400             'android/platform_jni_loader.h',
401             'app/android/cast_jni_loader.cc',
402             'browser/android/cast_window_android.cc',
403             'browser/android/cast_window_android.h',
404             'browser/android/cast_window_manager.cc',
405             'browser/android/cast_window_manager.h',
406             'browser/android/external_video_surface_container_impl.cc',
407             'browser/android/external_video_surface_container_impl.h',
408             'crash/android/cast_crash_reporter_client_android.cc',
409             'crash/android/cast_crash_reporter_client_android.h',
410             'crash/android/crash_handler.cc',
411             'crash/android/crash_handler.h',
412           ],
413           'conditions': [
414             ['chromecast_branding=="Chrome"', {
415               'dependencies': [
416                 'internal/chromecast_internal.gyp:cast_shell_android_internal'
417               ],
418             }, {
419               'sources': [
420                 'android/chromecast_config_android_stub.cc',
421                 'android/platform_jni_loader_stub.cc',
422               ],
423             }]
424           ],
425         },  # end of target 'libcast_shell_android'
426         {
427           'target_name': 'cast_shell_java',
428           'type': 'none',
429           'dependencies': [
430             '<(android_support_v13_target)',
431             '../base/base.gyp:base_java',
432             '../content/content.gyp:content_java',
433             '../media/media.gyp:media_java',
434             '../net/net.gyp:net_java',
435             '../ui/android/ui_android.gyp:ui_java',
436           ],
437           'variables': {
438             'has_java_resources': 1,
439             'java_in_dir': 'browser/android/apk',
440             'resource_dir': 'browser/android/apk/res',
441             'R_package': 'org.chromium.chromecast.shell',
442           },
443           'includes': ['../build/java.gypi'],
444         },  # end of target 'cast_shell_java'
445         {
446           'target_name': 'cast_shell_manifest',
447           'type': 'none',
448           'variables': {
449             'jinja_inputs': ['browser/android/apk/AndroidManifest.xml.jinja2'],
450             'jinja_output': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
451           },
452           'includes': [ '../build/android/jinja_template.gypi' ],
453         },
454         {
455           'target_name': 'cast_shell_apk',
456           'type': 'none',
457           'dependencies': [
458             'cast_shell_java',
459             'libcast_shell_android',
460           ],
461           'variables': {
462             'apk_name': 'CastShell',
463             'manifest_package_name': 'org.chromium.chromecast.shell',
464             # Note(gunsch): there are no Java files in the android/ directory.
465             # Unfortunately, the java_apk.gypi target rigidly insists on having
466             # a java_in_dir directory, but complains about duplicate classes
467             # from the common cast_shell_java target (shared with internal APK)
468             # if the actual Java path is used.
469             # This will hopefully be removable after the great GN migration.
470             'java_in_dir': 'android',
471             'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
472             'package_name': 'org.chromium.chromecast.shell',
473             'native_lib_target': 'libcast_shell_android',
474             'asset_location': '<(PRODUCT_DIR)/assets',
475             'additional_input_paths': ['<(PRODUCT_DIR)/assets/cast_shell.pak'],
476           },
477           'includes': [ '../build/java_apk.gypi' ],
478         },
479         {
480           'target_name': 'cast_jni_headers',
481           'type': 'none',
482           'sources': [
483             'browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java',
484             'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java',
485             'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowManager.java',
486             'browser/android/apk/src/org/chromium/chromecast/shell/ExternalVideoSurfaceContainer.java',
487           ],
488           'direct_dependent_settings': {
489             'include_dirs': [
490               '<(SHARED_INTERMEDIATE_DIR)/chromecast',
491             ],
492           },
493           'variables': {
494             'jni_gen_package': 'chromecast',
495           },
496           'includes': [ '../build/jni_generator.gypi' ],
497         },
498       ],  # end of targets
499     }, {  # OS != "android"
500       'targets': [
501         {
502           'target_name': 'cast_shell_media',
503           'type': '<(component)',
504           'dependencies': [
505             'media/media.gyp:cast_media',
506             '../content/content.gyp:content',
507             '../ipc/ipc.gyp:ipc',
508             '../media/media.gyp:media',
509           ],
510           'sources': [
511             'browser/media/cast_browser_cdm_factory.cc',
512             'browser/media/cast_browser_cdm_factory.h',
513             'browser/media/cma_message_filter_host.cc',
514             'browser/media/cma_message_filter_host.h',
515             'browser/media/cma_message_loop.cc',
516             'browser/media/cma_message_loop.h',
517             'browser/media/media_pipeline_host.cc',
518             'browser/media/media_pipeline_host.h',
519             'common/media/cma_ipc_common.h',
520             'common/media/cma_messages.h',
521             'common/media/cma_message_generator.cc',
522             'common/media/cma_message_generator.h',
523             'common/media/cma_param_traits.cc',
524             'common/media/cma_param_traits.h',
525             'common/media/shared_memory_chunk.cc',
526             'common/media/shared_memory_chunk.h',
527             'renderer/media/audio_pipeline_proxy.cc',
528             'renderer/media/audio_pipeline_proxy.h',
529             'renderer/media/chromecast_media_renderer_factory.cc',
530             'renderer/media/chromecast_media_renderer_factory.h',
531             'renderer/media/cma_message_filter_proxy.cc',
532             'renderer/media/cma_message_filter_proxy.h',
533             'renderer/media/media_channel_proxy.cc',
534             'renderer/media/media_channel_proxy.h',
535             'renderer/media/media_pipeline_proxy.cc',
536             'renderer/media/media_pipeline_proxy.h',
537             'renderer/media/video_pipeline_proxy.cc',
538             'renderer/media/video_pipeline_proxy.h',
539           ],
540         },  # end of target 'cast_shell_media'
541         # This target contains all of the primary code of |cast_shell|, except
542         # for |main|. This allows end-to-end tests using |cast_shell|.
543         # This also includes all targets that cannot be built on Android.
544         {
545           'target_name': 'cast_shell_core',
546           'type': '<(component)',
547           'dependencies': [
548             'cast_ozone',
549             'cast_shell_media',
550             'cast_shell_common',
551             'media/media.gyp:cast_media',
552             '../ui/aura/aura.gyp:aura_test_support',
553           ],
554           'conditions': [
555             ['chromecast_branding=="Chrome"', {
556               'dependencies': [
557                 'internal/chromecast_internal.gyp:cast_gfx_internal',
558               ],
559             }, {
560               'dependencies': [
561                 '../ui/ozone/ozone.gyp:eglplatform_shim_x11',
562               ],
563             }],
564           ],
565         },
566         {
567           'target_name': 'cast_shell',
568           'type': 'executable',
569           'dependencies': [
570             'cast_shell_core',
571           ],
572           'sources': [
573             'app/cast_main.cc',
574           ],
575           # TODO(dougsteed): remove when Chromecast moves to boringssl.
576           # Allow the cast shell to find the NSS module in the same directory.
577           'ldflags': [
578             '-Wl,-rpath=\$$ORIGIN'
579           ],
580         },
581       ],  # end of targets
582     }],
583   ],  # end of conditions