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',
78 'base/android/dumpstate_writer.cc',
79 'base/android/dumpstate_writer.h',
80 'base/android/system_time_change_notifier_android.cc',
81 'base/android/system_time_change_notifier_android.h',
84 'base/chromecast_config_android.cc',
85 'base/chromecast_config_android.h',
86 'base/chromecast_switches.cc',
87 'base/chromecast_switches.h',
88 'base/error_codes.cc',
90 'base/metrics/cast_histograms.h',
91 'base/metrics/cast_metrics_helper.cc',
92 'base/metrics/cast_metrics_helper.h',
93 'base/metrics/grouped_histogram.cc',
94 'base/metrics/grouped_histogram.h',
99 'base/process_utils.cc',
100 'base/process_utils.h',
101 'base/serializers.cc',
102 'base/serializers.h',
103 'base/system_time_change_notifier.cc',
104 'base/system_time_change_notifier.h',
105 'base/task_runner_impl.cc',
106 'base/task_runner_impl.h',
115 }, # end of target 'cast_base'
117 'target_name': 'cast_crash',
118 'type': '<(component)',
120 # TODO(gfhuang): we should not need to include this directly, but
121 # somehow depending on component.gyp:breakpad_component is not
122 # working as expected.
127 'cast_version_header',
128 '../breakpad/breakpad.gyp:breakpad_client',
131 'crash/app_state_tracker.cc',
132 'crash/app_state_tracker.h',
133 'crash/cast_crash_keys.cc',
134 'crash/cast_crash_keys.h',
135 'crash/cast_crashdump_uploader.cc',
136 'crash/cast_crashdump_uploader.h',
137 'crash/linux/crash_util.cc',
138 'crash/linux/crash_util.h',
139 'crash/linux/dummy_minidump_generator.cc',
140 'crash/linux/dummy_minidump_generator.h',
141 'crash/linux/dump_info.cc',
142 'crash/linux/dump_info.h',
143 'crash/linux/minidump_generator.h',
144 'crash/linux/synchronized_minidump_manager.cc',
145 'crash/linux/synchronized_minidump_manager.h',
146 'crash/linux/minidump_params.cc',
147 'crash/linux/minidump_params.h',
148 'crash/linux/minidump_writer.cc',
149 'crash/linux/minidump_writer.h',
151 }, # end of target 'cast_crash'
153 'target_name': 'cast_crash_client',
154 'type': '<(component)',
157 '../breakpad/breakpad.gyp:breakpad_client',
158 '../components/components.gyp:crash_component',
159 '../content/content.gyp:content_common',
165 'app/android/crash_handler.cc',
166 'app/android/crash_handler.h',
167 'app/android/cast_crash_reporter_client_android.cc',
168 'app/android/cast_crash_reporter_client_android.h',
169 'app/linux/cast_crash_reporter_client.cc',
170 'app/linux/cast_crash_reporter_client.h',
179 }, # end of target 'cast_crash_client'
181 'target_name': 'cast_net',
182 'type': '<(component)',
184 'net/connectivity_checker.cc',
185 'net/connectivity_checker.h',
186 'net/connectivity_checker_impl.cc',
187 'net/connectivity_checker_impl.h',
188 'net/fake_connectivity_checker.cc',
189 'net/fake_connectivity_checker.h',
190 'net/net_switches.cc',
191 'net/net_switches.h',
192 'net/net_util_cast.cc',
193 'net/net_util_cast.h',
198 'net/network_change_notifier_factory_cast.cc',
199 'net/network_change_notifier_factory_cast.h',
205 'target_name': 'cast_shell_resources',
208 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chromecast',
212 'action_name': 'cast_shell_resources',
214 'grit_grd_file': 'app/resources/shell_resources.grd',
215 'grit_resource_ids': 'app/resources/resource_ids',
217 'includes': [ '../build/grit_action.gypi' ],
220 'includes': [ '../build/grit_target.gypi' ],
223 'target_name': 'cast_shell_pak',
226 'cast_shell_resources',
227 '../content/app/resources/content_resources.gyp:content_resources',
228 '../content/app/strings/content_strings.gyp:content_strings',
229 '../net/net.gyp:net_resources',
230 '../third_party/WebKit/public/blink_resources.gyp:blink_resources',
231 '../ui/resources/ui_resources.gyp:ui_resources',
232 '../ui/strings/ui_strings.gyp:ui_strings',
236 'action_name': 'repack_cast_shell_pak',
239 '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
240 '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_image_resources_100_percent.pak',
241 '<(SHARED_INTERMEDIATE_DIR)/chromecast/shell_resources.pak',
242 '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
243 '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
244 '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak',
245 '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
246 '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
247 '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
248 '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
249 '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
252 ['chromecast_branding!="public" and use_chromecast_webui==1', {
254 '<(SHARED_INTERMEDIATE_DIR)/chromecast/app_resources.pak',
255 '<(SHARED_INTERMEDIATE_DIR)/chromecast/cast_webui_resources.pak',
258 ['chromecast_branding!="public"', {
260 '<(SHARED_INTERMEDIATE_DIR)/chromecast/sound_resources.pak',
264 'pak_output': '<(PRODUCT_DIR)/assets/cast_shell.pak',
266 'includes': [ '../build/repack_action.gypi' ],
270 ['chromecast_branding!="public" and use_chromecast_webui==1', {
272 'internal/chromecast_resources.gyp:chromecast_app_resources',
273 'internal/chromecast_resources.gyp:chromecast_webui_resources',
276 ['chromecast_branding!="public"', {
278 'internal/chromecast_resources.gyp:chromecast_sound_resources',
282 }, # end of target 'cast_shell_pak'
283 # This target contains all content-embedder implementation that is
284 # non-platform-specific.
286 'target_name': 'cast_shell_common',
287 'type': '<(component)',
293 'cast_shell_resources',
295 'cast_version_header',
296 'chromecast_locales.gyp:chromecast_locales_pak',
297 'chromecast_locales.gyp:chromecast_settings',
298 'media/media.gyp:media_base',
299 'media/media.gyp:media_cdm',
300 '../base/base.gyp:base',
301 '../components/components.gyp:breakpad_host',
302 '../components/components.gyp:cdm_renderer',
303 '../components/components.gyp:component_metrics_proto',
304 '../components/components.gyp:crash_component',
305 '../components/components.gyp:devtools_discovery',
306 '../components/components.gyp:devtools_http_handler',
307 '../components/components.gyp:network_hints_browser',
308 '../components/components.gyp:network_hints_renderer',
309 '../components/components.gyp:metrics',
310 '../components/components.gyp:metrics_gpu',
311 '../components/components.gyp:metrics_net',
312 '../components/components.gyp:metrics_profiler',
313 '../content/content.gyp:content',
314 '../content/content.gyp:content_app_both',
315 '../skia/skia.gyp:skia',
316 '../third_party/WebKit/public/blink.gyp:blink',
317 '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
320 'app/cast_main_delegate.cc',
321 'app/cast_main_delegate.h',
322 'browser/android/cast_window_android.cc',
323 'browser/android/cast_window_android.h',
324 'browser/android/cast_window_manager.cc',
325 'browser/android/cast_window_manager.h',
326 'browser/cast_browser_context.cc',
327 'browser/cast_browser_context.h',
328 'browser/cast_browser_main_parts.cc',
329 'browser/cast_browser_main_parts.h',
330 'browser/cast_browser_process.cc',
331 'browser/cast_browser_process.h',
332 'browser/cast_content_browser_client.cc',
333 'browser/cast_content_browser_client.h',
334 'browser/cast_content_window.cc',
335 'browser/cast_content_window.h',
336 'browser/cast_download_manager_delegate.cc',
337 'browser/cast_download_manager_delegate.h',
338 'browser/cast_http_user_agent_settings.cc',
339 'browser/cast_http_user_agent_settings.h',
340 'browser/cast_net_log.cc',
341 'browser/cast_net_log.h',
342 'browser/cast_network_delegate.cc',
343 'browser/cast_network_delegate.h',
344 'browser/cast_permission_manager.cc',
345 'browser/cast_permission_manager.h',
346 'browser/cast_quota_permission_context.cc',
347 'browser/cast_quota_permission_context.h',
348 'browser/cast_resource_dispatcher_host_delegate.cc',
349 'browser/cast_resource_dispatcher_host_delegate.h',
350 'browser/devtools/cast_dev_tools_delegate.cc',
351 'browser/devtools/cast_dev_tools_delegate.h',
352 'browser/devtools/remote_debugging_server.cc',
353 'browser/devtools/remote_debugging_server.h',
354 'browser/geolocation/cast_access_token_store.cc',
355 'browser/geolocation/cast_access_token_store.h',
356 'browser/media/cast_media_client_android.cc',
357 'browser/media/cast_media_client_android.h',
358 'browser/metrics/cast_metrics_prefs.cc',
359 'browser/metrics/cast_metrics_prefs.h',
360 'browser/metrics/cast_metrics_service_client.cc',
361 'browser/metrics/cast_metrics_service_client.h',
362 'browser/metrics/cast_stability_metrics_provider.cc',
363 'browser/metrics/cast_stability_metrics_provider.h',
364 'browser/pref_service_helper.cc',
365 'browser/pref_service_helper.h',
366 'browser/service/cast_service.cc',
367 'browser/service/cast_service.h',
368 'browser/url_request_context_factory.cc',
369 'browser/url_request_context_factory.h',
370 'common/cast_content_client.cc',
371 'common/cast_content_client.h',
372 'common/cast_resource_delegate.cc',
373 'common/cast_resource_delegate.h',
374 'common/media/cast_messages.h',
375 'common/media/cast_message_generator.cc',
376 'common/media/cast_message_generator.h',
377 'common/platform_client_auth.h',
378 'renderer/cast_content_renderer_client.cc',
379 'renderer/cast_content_renderer_client.h',
380 'renderer/cast_media_load_deferrer.cc',
381 'renderer/cast_media_load_deferrer.h',
382 'renderer/cast_render_process_observer.cc',
383 'renderer/cast_render_process_observer.h',
384 'renderer/key_systems_cast.cc',
385 'renderer/key_systems_cast.h',
386 'renderer/media/capabilities_message_filter.cc',
387 'renderer/media/capabilities_message_filter.h',
390 ['chromecast_branding!="public"', {
392 'internal/chromecast_internal.gyp:cast_shell_internal',
396 'browser/cast_content_browser_client_simple.cc',
397 'browser/cast_network_delegate_simple.cc',
398 'browser/devtools/remote_debugging_server_simple.cc',
399 'browser/pref_service_helper_simple.cc',
400 'browser/service/cast_service_android.cc',
401 'browser/service/cast_service_android.h',
402 'common/platform_client_auth_simple.cc',
403 'renderer/cast_content_renderer_client_simple.cc',
408 'browser/media/cast_browser_cdm_factory_simple.cc',
409 'browser/service/cast_service_simple.cc',
410 'browser/service/cast_service_simple.h',
415 # ExternalMetrics not necessary on Android and (as of this writing) uses
416 # non-portable filesystem operations. Also webcrypto is not used on
420 'browser/metrics/external_metrics.cc',
421 'browser/metrics/external_metrics.h',
422 'graphics/cast_screen.cc',
423 'graphics/cast_screen.h',
426 '../components/components.gyp:metrics_serialization',
431 '../components/components.gyp:cdm_browser',
432 '../components/components.gyp:external_video_surface',
439 'target_name': 'cast_sys_info',
440 'type': '<(component)',
443 '../base/base.gyp:base',
446 'base/cast_sys_info_util.h',
447 'base/cast_sys_info_dummy.cc',
448 'base/cast_sys_info_dummy.h',
449 'base/cast_sys_info_android.cc',
450 'base/cast_sys_info_android.h',
458 ['chromecast_branding=="public" and OS!="android"', {
460 'base/cast_sys_info_util_simple.cc',
464 }, # end of target 'cast_sys_info'
466 'target_name': 'cast_version_header',
468 'direct_dependent_settings': {
470 '<(SHARED_INTERMEDIATE_DIR)',
475 'action_name': 'version_header',
476 'message': 'Generating version header file: <@(_outputs)',
482 '<(SHARED_INTERMEDIATE_DIR)/chromecast/base/version.h',
486 '<(version_py_path)',
487 '-e', 'VERSION_FULL="<(version_full)"',
488 # CAST_BUILD_INCREMENTAL is taken from buildbot if available;
489 # otherwise, a dev string is used.
490 '-e', 'CAST_BUILD_INCREMENTAL="<!(echo ${CAST_BUILD_INCREMENTAL:="<!(date +%Y%m%d.%H%M%S)"})"',
491 # CAST_BUILD_RELEASE is taken from cast_build_release file if exist;
492 # otherwise, a dev string is used.
493 '-e', 'CAST_BUILD_RELEASE="<!(if test -f <(cast_build_release); then cat <(cast_build_release); else echo eng.${USER}; fi)"',
494 '-e', 'CAST_IS_DEBUG_BUILD=1 if "<(CONFIGURATION_NAME)" == "Debug" or <(cast_is_debug_build) == 1 else 0',
495 '-e', 'CAST_PRODUCT_TYPE=<(cast_product_type)',
500 '../build/util/version.gypi',
507 # Targets for Android receiver.
512 'target_name': 'cast_shell_icudata',
515 '../third_party/icu/icu.gyp:icudata',
516 '../v8/tools/gyp/v8.gyp:v8_external_snapshot',
519 'destination': '<(PRODUCT_DIR)/assets',
521 '<(PRODUCT_DIR)/icudtl.dat',
522 '<(PRODUCT_DIR)/natives_blob.bin',
523 '<(PRODUCT_DIR)/snapshot_blob.bin',
528 'target_name': 'libcast_shell_android',
529 'type': 'shared_library',
533 'cast_shell_icudata',
535 'cast_version_header',
536 '../base/base.gyp:base',
537 '../components/components.gyp:breakpad_host',
538 '../content/content.gyp:content',
539 '../skia/skia.gyp:skia',
540 '../ui/gfx/gfx.gyp:gfx',
541 '../ui/gl/gl.gyp:gl',
544 'android/cast_jni_registrar.cc',
545 'android/cast_jni_registrar.h',
546 'android/cast_metrics_helper_android.cc',
547 'android/cast_metrics_helper_android.h',
548 'android/platform_jni_loader.h',
549 'app/android/cast_jni_loader.cc',
552 ['chromecast_branding!="public"', {
554 'internal/chromecast_internal.gyp:cast_shell_android_internal'
558 'android/platform_jni_loader_stub.cc',
562 }, # end of target 'libcast_shell_android'
564 'target_name': 'cast_base_java',
567 '../base/base.gyp:base_java',
570 'android_manifest_path': 'android/AndroidManifest.xml',
571 'java_in_dir': 'base/java',
573 'includes': ['../build/java.gypi'],
574 }, # end of target 'cast_base_java'
576 'target_name': 'cast_shell_java',
579 '<(android_support_v13_target)',
581 'cast_shell_manifest',
582 '../base/base.gyp:base_java',
583 '../components/components.gyp:external_video_surface_java',
584 '../content/content.gyp:content_java',
585 '../media/media.gyp:media_java',
586 '../net/net.gyp:net_java',
587 '../ui/android/ui_android.gyp:ui_java',
590 'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
591 'has_java_resources': 1,
592 'java_in_dir': 'browser/android/apk',
593 'resource_dir': 'browser/android/apk/res',
594 'R_package': 'org.chromium.chromecast.shell',
596 'includes': ['../build/java.gypi'],
597 }, # end of target 'cast_shell_java'
599 'target_name': 'cast_shell_manifest',
602 'jinja_inputs': ['browser/android/apk/AndroidManifest.xml.jinja2'],
603 'jinja_output': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
605 'includes': [ '../build/android/jinja_template.gypi' ],
608 'target_name': 'cast_shell_apk',
612 'libcast_shell_android',
615 'apk_name': 'CastShell',
616 'manifest_package_name': 'org.chromium.chromecast.shell',
617 # Note(gunsch): there are no Java files in the android/ directory.
618 # Unfortunately, the java_apk.gypi target rigidly insists on having
619 # a java_in_dir directory, but complains about duplicate classes
620 # from the common cast_shell_java target (shared with internal APK)
621 # if the actual Java path is used.
622 # This will hopefully be removable after the great GN migration.
623 'java_in_dir': 'android',
624 'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
625 'package_name': 'org.chromium.chromecast.shell',
626 'native_lib_target': 'libcast_shell_android',
627 'asset_location': '<(PRODUCT_DIR)/assets',
628 'additional_input_paths': ['<(PRODUCT_DIR)/assets/cast_shell.pak'],
630 'includes': [ '../build/java_apk.gypi' ],
633 'target_name': 'cast_jni_headers',
636 'base/java/src/org/chromium/chromecast/base/ChromecastConfigAndroid.java',
637 'base/java/src/org/chromium/chromecast/base/DumpstateWriter.java',
638 'base/java/src/org/chromium/chromecast/base/SystemTimeChangeNotifierAndroid.java',
639 'browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java',
640 'browser/android/apk/src/org/chromium/chromecast/shell/CastMetricsHelper.java',
641 'browser/android/apk/src/org/chromium/chromecast/shell/CastSysInfoAndroid.java',
642 'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java',
643 'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowManager.java',
645 'direct_dependent_settings': {
647 '<(SHARED_INTERMEDIATE_DIR)/chromecast',
651 'jni_gen_package': 'chromecast',
653 'includes': [ '../build/jni_generator.gypi' ],
656 }, { # OS != "android"
659 'target_name': 'cast_shell_media',
660 'type': '<(component)',
663 'media/media.gyp:cast_media',
664 '../content/content.gyp:content',
665 '../ipc/ipc.gyp:ipc',
666 '../media/media.gyp:media',
669 'browser/media/cast_browser_cdm_factory.cc',
670 'browser/media/cast_browser_cdm_factory.h',
671 'browser/media/cma_message_filter_host.cc',
672 'browser/media/cma_message_filter_host.h',
673 'browser/media/media_pipeline_host.cc',
674 'browser/media/media_pipeline_host.h',
675 'common/media/cma_ipc_common.h',
676 'common/media/cma_messages.h',
677 'common/media/cma_message_generator.cc',
678 'common/media/cma_message_generator.h',
679 'common/media/cma_param_traits.cc',
680 'common/media/cma_param_traits.h',
681 'common/media/shared_memory_chunk.cc',
682 'common/media/shared_memory_chunk.h',
683 'renderer/media/audio_pipeline_proxy.cc',
684 'renderer/media/audio_pipeline_proxy.h',
685 'renderer/media/chromecast_media_renderer_factory.cc',
686 'renderer/media/chromecast_media_renderer_factory.h',
687 'renderer/media/cma_message_filter_proxy.cc',
688 'renderer/media/cma_message_filter_proxy.h',
689 'renderer/media/media_channel_proxy.cc',
690 'renderer/media/media_channel_proxy.h',
691 'renderer/media/media_pipeline_proxy.cc',
692 'renderer/media/media_pipeline_proxy.h',
693 'renderer/media/video_pipeline_proxy.cc',
694 'renderer/media/video_pipeline_proxy.h',
696 }, # end of target 'cast_shell_media'
697 # This target contains all of the primary code of |cast_shell|, except
698 # for |main|. This allows end-to-end tests using |cast_shell|.
699 # This also includes all targets that cannot be built on Android.
701 'target_name': 'cast_shell_core',
702 'type': '<(component)',
706 'media/media.gyp:cast_media',
709 ['ozone_platform_egltest==1', {
711 '../ui/ozone/ozone.gyp:eglplatform_shim_x11',
717 'target_name': 'cast_shell',
718 'type': 'executable',
726 # Allow OEMs to override default libraries that are shipped with
727 # cast receiver package by installed OEM-specific libraries in
729 '-Wl,-rpath=/oem_cast_shlib',
730 # TODO(dougsteed): remove when Chromecast moves to boringssl.
731 # Allow the cast shell to find the NSS module in the same
733 '-Wl,-rpath=\$$ORIGIN'
738 ['enable_default_cast_graphics==1', {
741 'target_name': 'libcast_graphics_1.0',
742 'type': 'shared_library',
747 'graphics/cast_egl_platform_default.cc',
748 'graphics/graphics_properties_default.cc',
749 'graphics/osd_plane_default.cc'
754 ], # end of conditions