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