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.
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 'cast_is_debug_build%': 0,
11 # Refers to enum CastProductType in components/metrics/proto/cast_logs.proto
12 'cast_product_type%': 0, # CAST_PRODUCT_TYPE_UNKNOWN
14 'chromecast_branding%': 'public',
15 'disable_display%': 0,
16 'enable_default_cast_graphics%': 1,
17 'ozone_platform_cast%': 0,
18 'use_chromecast_webui%': 0,
21 'chromecast_tests.gypi',
25 '..', # Root of Chromium checkout
28 ['disable_display==1', {
29 'defines': ['DISABLE_DISPLAY'],
34 # Public API target for OEM partners to replace shlibs.
36 'target_name': 'cast_public_api',
37 'type': '<(component)',
39 'public/cast_egl_platform.h',
40 'public/cast_egl_platform_shlib.h',
41 'public/cast_media_shlib.h',
42 'public/cast_sys_info.h',
43 'public/chromecast_export.h',
44 'public/graphics_properties_shlib.h',
45 'public/graphics_types.h',
46 'public/media_codec_support.h',
47 'public/media/audio_pipeline_device.h',
48 'public/media/cast_decoder_buffer.h',
49 'public/media/cast_decrypt_config.h',
50 'public/media/cast_key_system.h',
51 'public/media/decoder_config.h',
52 'public/media/decrypt_context.h',
53 'public/media/media_clock_device.h',
54 'public/media/media_component_device.h',
55 'public/media/media_pipeline_backend.h',
56 'public/media/media_pipeline_device_params.h',
57 'public/media/stream_id.h',
58 'public/media/video_pipeline_device.h',
60 'public/osd_plane_shlib.h',
61 'public/osd_surface.h',
62 'public/task_runner.h',
63 'public/video_plane.h',
65 'direct_dependent_settings': {
72 'target_name': 'cast_base',
73 'type': '<(component)',
75 '../base/base.gyp:base',
80 'base/chromecast_config_android.cc',
81 'base/chromecast_config_android.h',
82 'base/chromecast_switches.cc',
83 'base/chromecast_switches.h',
84 'base/error_codes.cc',
86 'base/metrics/cast_histograms.h',
87 'base/metrics/cast_metrics_helper.cc',
88 'base/metrics/cast_metrics_helper.h',
89 'base/metrics/grouped_histogram.cc',
90 'base/metrics/grouped_histogram.h',
93 'base/process_utils.cc',
94 'base/process_utils.h',
95 'base/serializers.cc',
97 'base/task_runner_impl.cc',
98 'base/task_runner_impl.h',
107 }, # end of target 'cast_base'
109 'target_name': 'cast_crash',
110 'type': '<(component)',
112 # TODO(gfhuang): we should not need to include this directly, but
113 # somehow depending on component.gyp:breakpad_component is not
114 # working as expected.
119 'cast_version_header',
120 '../breakpad/breakpad.gyp:breakpad_client',
123 'crash/app_state_tracker.cc',
124 'crash/app_state_tracker.h',
125 'crash/cast_crash_keys.cc',
126 'crash/cast_crash_keys.h',
127 'crash/cast_crashdump_uploader.cc',
128 'crash/cast_crashdump_uploader.h',
129 'crash/linux/crash_util.cc',
130 'crash/linux/crash_util.h',
131 'crash/linux/dummy_minidump_generator.cc',
132 'crash/linux/dummy_minidump_generator.h',
133 'crash/linux/dump_info.cc',
134 'crash/linux/dump_info.h',
135 'crash/linux/minidump_generator.h',
136 'crash/linux/synchronized_minidump_manager.cc',
137 'crash/linux/synchronized_minidump_manager.h',
138 'crash/linux/minidump_params.cc',
139 'crash/linux/minidump_params.h',
140 'crash/linux/minidump_writer.cc',
141 'crash/linux/minidump_writer.h',
143 }, # end of target 'cast_crash'
145 'target_name': 'cast_crash_client',
146 'type': '<(component)',
149 '../breakpad/breakpad.gyp:breakpad_client',
150 '../components/components.gyp:crash_component',
151 '../content/content.gyp:content_common',
157 'app/android/crash_handler.cc',
158 'app/android/crash_handler.h',
159 'app/android/cast_crash_reporter_client_android.cc',
160 'app/android/cast_crash_reporter_client_android.h',
161 'app/linux/cast_crash_reporter_client.cc',
162 'app/linux/cast_crash_reporter_client.h',
171 }, # end of target 'cast_crash_client'
173 'target_name': 'cast_net',
174 'type': '<(component)',
176 'net/connectivity_checker.cc',
177 'net/connectivity_checker.h',
178 'net/connectivity_checker_impl.cc',
179 'net/connectivity_checker_impl.h',
180 'net/fake_connectivity_checker.cc',
181 'net/fake_connectivity_checker.h',
182 'net/net_switches.cc',
183 'net/net_switches.h',
184 'net/net_util_cast.cc',
185 'net/net_util_cast.h',
190 'net/network_change_notifier_factory_cast.cc',
191 'net/network_change_notifier_factory_cast.h',
197 'target_name': 'cast_shell_resources',
200 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chromecast',
204 'action_name': 'cast_shell_resources',
206 'grit_grd_file': 'app/resources/shell_resources.grd',
207 'grit_resource_ids': 'app/resources/resource_ids',
209 'includes': [ '../build/grit_action.gypi' ],
212 'includes': [ '../build/grit_target.gypi' ],
215 'target_name': 'cast_shell_pak',
218 'cast_shell_resources',
219 '../content/app/resources/content_resources.gyp:content_resources',
220 '../content/app/strings/content_strings.gyp:content_strings',
221 '../net/net.gyp:net_resources',
222 '../third_party/WebKit/public/blink_resources.gyp:blink_resources',
223 '../ui/resources/ui_resources.gyp:ui_resources',
224 '../ui/strings/ui_strings.gyp:ui_strings',
228 'action_name': 'repack_cast_shell_pak',
231 '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
232 '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_image_resources_100_percent.pak',
233 '<(SHARED_INTERMEDIATE_DIR)/chromecast/shell_resources.pak',
234 '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
235 '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
236 '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak',
237 '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
238 '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
239 '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
240 '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
241 '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
244 ['chromecast_branding!="public" and use_chromecast_webui==1', {
246 '<(SHARED_INTERMEDIATE_DIR)/chromecast/app_resources.pak',
247 '<(SHARED_INTERMEDIATE_DIR)/chromecast/cast_webui_resources.pak',
251 'pak_output': '<(PRODUCT_DIR)/assets/cast_shell.pak',
253 'includes': [ '../build/repack_action.gypi' ],
257 ['chromecast_branding!="public" and use_chromecast_webui==1', {
259 'internal/chromecast_resources.gyp:chromecast_app_resources',
260 'internal/chromecast_resources.gyp:chromecast_webui_resources',
264 }, # end of target 'cast_shell_pak'
265 # This target contains all content-embedder implementation that is
266 # non-platform-specific.
268 'target_name': 'cast_shell_common',
269 'type': '<(component)',
275 'cast_shell_resources',
277 'cast_version_header',
278 'chromecast_locales.gyp:chromecast_locales_pak',
279 'chromecast_locales.gyp:chromecast_settings',
280 'media/media.gyp:media_base',
281 'media/media.gyp:media_cdm',
282 '../base/base.gyp:base',
283 '../components/components.gyp:breakpad_host',
284 '../components/components.gyp:cdm_renderer',
285 '../components/components.gyp:component_metrics_proto',
286 '../components/components.gyp:crash_component',
287 '../components/components.gyp:devtools_discovery',
288 '../components/components.gyp:devtools_http_handler',
289 '../components/components.gyp:network_hints_browser',
290 '../components/components.gyp:network_hints_renderer',
291 '../components/components.gyp:metrics',
292 '../components/components.gyp:metrics_gpu',
293 '../components/components.gyp:metrics_net',
294 '../components/components.gyp:metrics_profiler',
295 '../content/content.gyp:content',
296 '../content/content.gyp:content_app_both',
297 '../skia/skia.gyp:skia',
298 '../third_party/WebKit/public/blink.gyp:blink',
299 '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
302 'app/cast_main_delegate.cc',
303 'app/cast_main_delegate.h',
304 'browser/android/cast_window_android.cc',
305 'browser/android/cast_window_android.h',
306 'browser/android/cast_window_manager.cc',
307 'browser/android/cast_window_manager.h',
308 'browser/cast_browser_context.cc',
309 'browser/cast_browser_context.h',
310 'browser/cast_browser_main_parts.cc',
311 'browser/cast_browser_main_parts.h',
312 'browser/cast_browser_process.cc',
313 'browser/cast_browser_process.h',
314 'browser/cast_content_browser_client.cc',
315 'browser/cast_content_browser_client.h',
316 'browser/cast_content_window.cc',
317 'browser/cast_content_window.h',
318 'browser/cast_download_manager_delegate.cc',
319 'browser/cast_download_manager_delegate.h',
320 'browser/cast_http_user_agent_settings.cc',
321 'browser/cast_http_user_agent_settings.h',
322 'browser/cast_net_log.cc',
323 'browser/cast_net_log.h',
324 'browser/cast_network_delegate.cc',
325 'browser/cast_network_delegate.h',
326 'browser/cast_permission_manager.cc',
327 'browser/cast_permission_manager.h',
328 'browser/cast_quota_permission_context.cc',
329 'browser/cast_quota_permission_context.h',
330 'browser/cast_resource_dispatcher_host_delegate.cc',
331 'browser/cast_resource_dispatcher_host_delegate.h',
332 'browser/devtools/cast_dev_tools_delegate.cc',
333 'browser/devtools/cast_dev_tools_delegate.h',
334 'browser/devtools/remote_debugging_server.cc',
335 'browser/devtools/remote_debugging_server.h',
336 'browser/geolocation/cast_access_token_store.cc',
337 'browser/geolocation/cast_access_token_store.h',
338 'browser/media/cast_media_client_android.cc',
339 'browser/media/cast_media_client_android.h',
340 'browser/metrics/cast_metrics_prefs.cc',
341 'browser/metrics/cast_metrics_prefs.h',
342 'browser/metrics/cast_metrics_service_client.cc',
343 'browser/metrics/cast_metrics_service_client.h',
344 'browser/metrics/cast_stability_metrics_provider.cc',
345 'browser/metrics/cast_stability_metrics_provider.h',
346 'browser/metrics/platform_metrics_providers.h',
347 'browser/pref_service_helper.cc',
348 'browser/pref_service_helper.h',
349 'browser/service/cast_service.cc',
350 'browser/service/cast_service.h',
351 'browser/url_request_context_factory.cc',
352 'browser/url_request_context_factory.h',
353 'common/cast_content_client.cc',
354 'common/cast_content_client.h',
355 'common/cast_resource_delegate.cc',
356 'common/cast_resource_delegate.h',
357 'common/media/cast_messages.h',
358 'common/media/cast_message_generator.cc',
359 'common/media/cast_message_generator.h',
360 'common/platform_client_auth.h',
361 'common/pref_names.cc',
362 'common/pref_names.h',
363 'renderer/cast_content_renderer_client.cc',
364 'renderer/cast_content_renderer_client.h',
365 'renderer/cast_media_load_deferrer.cc',
366 'renderer/cast_media_load_deferrer.h',
367 'renderer/cast_render_process_observer.cc',
368 'renderer/cast_render_process_observer.h',
369 'renderer/key_systems_cast.cc',
370 'renderer/key_systems_cast.h',
371 'renderer/media/capabilities_message_filter.cc',
372 'renderer/media/capabilities_message_filter.h',
375 ['chromecast_branding!="public"', {
377 'internal/chromecast_internal.gyp:cast_shell_internal',
381 'browser/cast_content_browser_client_simple.cc',
382 'browser/cast_network_delegate_simple.cc',
383 'browser/devtools/remote_debugging_server_simple.cc',
384 'browser/metrics/platform_metrics_providers_simple.cc',
385 'browser/pref_service_helper_simple.cc',
386 'browser/service/cast_service_android.cc',
387 'browser/service/cast_service_android.h',
388 'common/platform_client_auth_simple.cc',
389 'renderer/cast_content_renderer_client_simple.cc',
394 'browser/media/cast_browser_cdm_factory_simple.cc',
395 'browser/service/cast_service_simple.cc',
396 'browser/service/cast_service_simple.h',
401 # ExternalMetrics not necessary on Android and (as of this writing) uses
402 # non-portable filesystem operations. Also webcrypto is not used on
406 'browser/metrics/external_metrics.cc',
407 'browser/metrics/external_metrics.h',
408 'graphics/cast_screen.cc',
409 'graphics/cast_screen.h',
412 '../components/components.gyp:metrics_serialization',
417 '../components/components.gyp:cdm_browser',
424 'target_name': 'cast_sys_info',
425 'type': '<(component)',
428 '../base/base.gyp:base',
431 'base/cast_sys_info_util.h',
432 'base/cast_sys_info_dummy.cc',
433 'base/cast_sys_info_dummy.h',
434 'base/cast_sys_info_android.cc',
435 'base/cast_sys_info_android.h',
443 ['chromecast_branding=="public" and OS!="android"', {
445 'base/cast_sys_info_util_simple.cc',
449 }, # end of target 'cast_sys_info'
451 'target_name': 'cast_version_header',
453 'direct_dependent_settings': {
455 '<(SHARED_INTERMEDIATE_DIR)',
460 'action_name': 'version_header',
461 'message': 'Generating version header file: <@(_outputs)',
467 '<(SHARED_INTERMEDIATE_DIR)/chromecast/base/version.h',
471 '<(version_py_path)',
472 '-e', 'VERSION_FULL="<(version_full)"',
473 # CAST_BUILD_INCREMENTAL is taken from buildbot if available;
474 # otherwise, a dev string is used.
475 '-e', 'CAST_BUILD_INCREMENTAL="<!(echo ${CAST_BUILD_INCREMENTAL:="<!(date +%Y%m%d.%H%M%S)"})"',
476 # CAST_BUILD_RELEASE is taken from cast_build_release file if exist;
477 # otherwise, a dev string is used.
478 '-e', 'CAST_BUILD_RELEASE="<!(if test -f <(cast_build_release); then cat <(cast_build_release); else echo eng.${USER}; fi)"',
479 '-e', 'CAST_IS_DEBUG_BUILD=1 if "<(CONFIGURATION_NAME)" == "Debug" or <(cast_is_debug_build) == 1 else 0',
480 '-e', 'CAST_PRODUCT_TYPE=<(cast_product_type)',
485 '../build/util/version.gypi',
492 # Targets for Android receiver.
497 'target_name': 'cast_shell_icudata',
500 '../third_party/icu/icu.gyp:icudata',
501 '../v8/tools/gyp/v8.gyp:v8_external_snapshot',
504 'destination': '<(PRODUCT_DIR)/assets',
506 '<(PRODUCT_DIR)/icudtl.dat',
507 '<(PRODUCT_DIR)/natives_blob.bin',
508 '<(PRODUCT_DIR)/snapshot_blob.bin',
513 'target_name': 'libcast_shell_android',
514 'type': 'shared_library',
518 'cast_shell_icudata',
520 'cast_version_header',
521 '../base/base.gyp:base',
522 '../components/components.gyp:breakpad_host',
523 '../components/components.gyp:external_video_surface',
524 '../content/content.gyp:content',
525 '../skia/skia.gyp:skia',
526 '../ui/gfx/gfx.gyp:gfx',
527 '../ui/gl/gl.gyp:gl',
530 'android/cast_jni_registrar.cc',
531 'android/cast_jni_registrar.h',
532 'android/cast_metrics_helper_android.cc',
533 'android/cast_metrics_helper_android.h',
534 'android/platform_jni_loader.h',
535 'app/android/cast_jni_loader.cc',
538 ['chromecast_branding!="public"', {
540 'internal/chromecast_internal.gyp:cast_shell_android_internal'
544 'android/platform_jni_loader_stub.cc',
548 }, # end of target 'libcast_shell_android'
550 'target_name': 'cast_base_java',
553 '../base/base.gyp:base_java',
556 'android_manifest_path': 'android/AndroidManifest.xml',
557 'java_in_dir': 'base/java',
559 'includes': ['../build/java.gypi'],
560 }, # end of target 'cast_base_java'
562 'target_name': 'cast_shell_java',
565 '<(android_support_v13_target)',
567 'cast_shell_manifest',
568 '../base/base.gyp:base_java',
569 '../components/components.gyp:external_video_surface_java',
570 '../content/content.gyp:content_java',
571 '../media/media.gyp:media_java',
572 '../net/net.gyp:net_java',
573 '../ui/android/ui_android.gyp:ui_java',
576 'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
577 'has_java_resources': 1,
578 'java_in_dir': 'browser/android/apk',
579 'resource_dir': 'browser/android/apk/res',
580 'R_package': 'org.chromium.chromecast.shell',
582 'includes': ['../build/java.gypi'],
583 }, # end of target 'cast_shell_java'
585 'target_name': 'cast_shell_manifest',
588 'jinja_inputs': ['browser/android/apk/AndroidManifest.xml.jinja2'],
589 'jinja_output': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
591 'includes': [ '../build/android/jinja_template.gypi' ],
594 'target_name': 'cast_shell_apk',
598 'libcast_shell_android',
601 'apk_name': 'CastShell',
602 'manifest_package_name': 'org.chromium.chromecast.shell',
603 # Note(gunsch): there are no Java files in the android/ directory.
604 # Unfortunately, the java_apk.gypi target rigidly insists on having
605 # a java_in_dir directory, but complains about duplicate classes
606 # from the common cast_shell_java target (shared with internal APK)
607 # if the actual Java path is used.
608 # This will hopefully be removable after the great GN migration.
609 'java_in_dir': 'android',
610 'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
611 'package_name': 'org.chromium.chromecast.shell',
612 'native_lib_target': 'libcast_shell_android',
613 'asset_location': '<(PRODUCT_DIR)/assets',
614 'additional_input_paths': ['<(PRODUCT_DIR)/assets/cast_shell.pak'],
616 'includes': [ '../build/java_apk.gypi' ],
619 'target_name': 'cast_jni_headers',
622 'base/java/src/org/chromium/chromecast/base/ChromecastConfigAndroid.java',
623 'browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java',
624 'browser/android/apk/src/org/chromium/chromecast/shell/CastMetricsHelper.java',
625 'browser/android/apk/src/org/chromium/chromecast/shell/CastSysInfoAndroid.java',
626 'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java',
627 'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowManager.java',
629 'direct_dependent_settings': {
631 '<(SHARED_INTERMEDIATE_DIR)/chromecast',
635 'jni_gen_package': 'chromecast',
637 'includes': [ '../build/jni_generator.gypi' ],
640 }, { # OS != "android"
643 'target_name': 'cast_shell_media',
644 'type': '<(component)',
647 'media/media.gyp:cast_media',
648 '../content/content.gyp:content',
649 '../ipc/ipc.gyp:ipc',
650 '../media/media.gyp:media',
653 'browser/media/cast_browser_cdm_factory.cc',
654 'browser/media/cast_browser_cdm_factory.h',
655 'browser/media/cma_message_filter_host.cc',
656 'browser/media/cma_message_filter_host.h',
657 'browser/media/media_pipeline_host.cc',
658 'browser/media/media_pipeline_host.h',
659 'common/media/cma_ipc_common.h',
660 'common/media/cma_messages.h',
661 'common/media/cma_message_generator.cc',
662 'common/media/cma_message_generator.h',
663 'common/media/cma_param_traits.cc',
664 'common/media/cma_param_traits.h',
665 'common/media/shared_memory_chunk.cc',
666 'common/media/shared_memory_chunk.h',
667 'renderer/media/audio_pipeline_proxy.cc',
668 'renderer/media/audio_pipeline_proxy.h',
669 'renderer/media/chromecast_media_renderer_factory.cc',
670 'renderer/media/chromecast_media_renderer_factory.h',
671 'renderer/media/cma_message_filter_proxy.cc',
672 'renderer/media/cma_message_filter_proxy.h',
673 'renderer/media/media_channel_proxy.cc',
674 'renderer/media/media_channel_proxy.h',
675 'renderer/media/media_pipeline_proxy.cc',
676 'renderer/media/media_pipeline_proxy.h',
677 'renderer/media/video_pipeline_proxy.cc',
678 'renderer/media/video_pipeline_proxy.h',
680 }, # end of target 'cast_shell_media'
681 # This target contains all of the primary code of |cast_shell|, except
682 # for |main|. This allows end-to-end tests using |cast_shell|.
683 # This also includes all targets that cannot be built on Android.
685 'target_name': 'cast_shell_core',
686 'type': '<(component)',
690 'media/media.gyp:cast_media',
693 ['ozone_platform_egltest==1', {
695 '../ui/ozone/ozone.gyp:eglplatform_shim_x11',
701 'target_name': 'cast_shell',
702 'type': 'executable',
710 # Allow OEMs to override default libraries that are shipped with
711 # cast receiver package by installed OEM-specific libraries in
713 '-Wl,-rpath=/oem_cast_shlib',
714 # TODO(dougsteed): remove when Chromecast moves to boringssl.
715 # Allow the cast shell to find the NSS module in the same
717 '-Wl,-rpath=\$$ORIGIN'
722 ['enable_default_cast_graphics==1', {
725 'target_name': 'libcast_graphics_1.0',
726 'type': 'shared_library',
731 'graphics/cast_egl_platform_default.cc',
732 'graphics/graphics_properties_default.cc',
733 'graphics/osd_plane_default.cc'
738 ], # end of conditions