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',
259 'pak_output': '<(PRODUCT_DIR)/assets/cast_shell.pak',
261 'includes': [ '../build/repack_action.gypi' ],
265 ['chromecast_branding!="public" and use_chromecast_webui==1', {
267 'internal/chromecast_resources.gyp:chromecast_app_resources',
268 'internal/chromecast_resources.gyp:chromecast_webui_resources',
272 }, # end of target 'cast_shell_pak'
273 # This target contains all content-embedder implementation that is
274 # non-platform-specific.
276 'target_name': 'cast_shell_common',
277 'type': '<(component)',
283 'cast_shell_resources',
285 'cast_version_header',
286 'chromecast_locales.gyp:chromecast_locales_pak',
287 'chromecast_locales.gyp:chromecast_settings',
288 'media/media.gyp:media_base',
289 'media/media.gyp:media_cdm',
290 '../base/base.gyp:base',
291 '../components/components.gyp:breakpad_host',
292 '../components/components.gyp:cdm_renderer',
293 '../components/components.gyp:component_metrics_proto',
294 '../components/components.gyp:crash_component',
295 '../components/components.gyp:devtools_discovery',
296 '../components/components.gyp:devtools_http_handler',
297 '../components/components.gyp:network_hints_browser',
298 '../components/components.gyp:network_hints_renderer',
299 '../components/components.gyp:metrics',
300 '../components/components.gyp:metrics_gpu',
301 '../components/components.gyp:metrics_net',
302 '../components/components.gyp:metrics_profiler',
303 '../content/content.gyp:content',
304 '../content/content.gyp:content_app_both',
305 '../skia/skia.gyp:skia',
306 '../third_party/WebKit/public/blink.gyp:blink',
307 '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
310 'app/cast_main_delegate.cc',
311 'app/cast_main_delegate.h',
312 'browser/android/cast_window_android.cc',
313 'browser/android/cast_window_android.h',
314 'browser/android/cast_window_manager.cc',
315 'browser/android/cast_window_manager.h',
316 'browser/cast_browser_context.cc',
317 'browser/cast_browser_context.h',
318 'browser/cast_browser_main_parts.cc',
319 'browser/cast_browser_main_parts.h',
320 'browser/cast_browser_process.cc',
321 'browser/cast_browser_process.h',
322 'browser/cast_content_browser_client.cc',
323 'browser/cast_content_browser_client.h',
324 'browser/cast_content_window.cc',
325 'browser/cast_content_window.h',
326 'browser/cast_download_manager_delegate.cc',
327 'browser/cast_download_manager_delegate.h',
328 'browser/cast_http_user_agent_settings.cc',
329 'browser/cast_http_user_agent_settings.h',
330 'browser/cast_net_log.cc',
331 'browser/cast_net_log.h',
332 'browser/cast_network_delegate.cc',
333 'browser/cast_network_delegate.h',
334 'browser/cast_permission_manager.cc',
335 'browser/cast_permission_manager.h',
336 'browser/cast_quota_permission_context.cc',
337 'browser/cast_quota_permission_context.h',
338 'browser/cast_resource_dispatcher_host_delegate.cc',
339 'browser/cast_resource_dispatcher_host_delegate.h',
340 'browser/devtools/cast_dev_tools_delegate.cc',
341 'browser/devtools/cast_dev_tools_delegate.h',
342 'browser/devtools/remote_debugging_server.cc',
343 'browser/devtools/remote_debugging_server.h',
344 'browser/geolocation/cast_access_token_store.cc',
345 'browser/geolocation/cast_access_token_store.h',
346 'browser/media/cast_media_client_android.cc',
347 'browser/media/cast_media_client_android.h',
348 'browser/metrics/cast_metrics_prefs.cc',
349 'browser/metrics/cast_metrics_prefs.h',
350 'browser/metrics/cast_metrics_service_client.cc',
351 'browser/metrics/cast_metrics_service_client.h',
352 'browser/metrics/cast_stability_metrics_provider.cc',
353 'browser/metrics/cast_stability_metrics_provider.h',
354 'browser/pref_service_helper.cc',
355 'browser/pref_service_helper.h',
356 'browser/service/cast_service.cc',
357 'browser/service/cast_service.h',
358 'browser/url_request_context_factory.cc',
359 'browser/url_request_context_factory.h',
360 'common/cast_content_client.cc',
361 'common/cast_content_client.h',
362 'common/cast_resource_delegate.cc',
363 'common/cast_resource_delegate.h',
364 'common/media/cast_messages.h',
365 'common/media/cast_message_generator.cc',
366 'common/media/cast_message_generator.h',
367 'common/platform_client_auth.h',
368 'renderer/cast_content_renderer_client.cc',
369 'renderer/cast_content_renderer_client.h',
370 'renderer/cast_media_load_deferrer.cc',
371 'renderer/cast_media_load_deferrer.h',
372 'renderer/cast_render_process_observer.cc',
373 'renderer/cast_render_process_observer.h',
374 'renderer/key_systems_cast.cc',
375 'renderer/key_systems_cast.h',
376 'renderer/media/capabilities_message_filter.cc',
377 'renderer/media/capabilities_message_filter.h',
380 ['chromecast_branding!="public"', {
382 'internal/chromecast_internal.gyp:cast_shell_internal',
386 'browser/cast_content_browser_client_simple.cc',
387 'browser/cast_network_delegate_simple.cc',
388 'browser/devtools/remote_debugging_server_simple.cc',
389 'browser/pref_service_helper_simple.cc',
390 'browser/service/cast_service_android.cc',
391 'browser/service/cast_service_android.h',
392 'common/platform_client_auth_simple.cc',
393 'renderer/cast_content_renderer_client_simple.cc',
398 'browser/media/cast_browser_cdm_factory_simple.cc',
399 'browser/service/cast_service_simple.cc',
400 'browser/service/cast_service_simple.h',
405 # ExternalMetrics not necessary on Android and (as of this writing) uses
406 # non-portable filesystem operations. Also webcrypto is not used on
410 'browser/metrics/external_metrics.cc',
411 'browser/metrics/external_metrics.h',
412 'graphics/cast_screen.cc',
413 'graphics/cast_screen.h',
416 '../components/components.gyp:metrics_serialization',
421 '../components/components.gyp:cdm_browser',
422 '../components/components.gyp:external_video_surface',
429 'target_name': 'cast_sys_info',
430 'type': '<(component)',
433 '../base/base.gyp:base',
436 'base/cast_sys_info_util.h',
437 'base/cast_sys_info_dummy.cc',
438 'base/cast_sys_info_dummy.h',
439 'base/cast_sys_info_android.cc',
440 'base/cast_sys_info_android.h',
448 ['chromecast_branding=="public" and OS!="android"', {
450 'base/cast_sys_info_util_simple.cc',
454 }, # end of target 'cast_sys_info'
456 'target_name': 'cast_version_header',
458 'direct_dependent_settings': {
460 '<(SHARED_INTERMEDIATE_DIR)',
465 'action_name': 'version_header',
466 'message': 'Generating version header file: <@(_outputs)',
472 '<(SHARED_INTERMEDIATE_DIR)/chromecast/base/version.h',
476 '<(version_py_path)',
477 '-e', 'VERSION_FULL="<(version_full)"',
478 # CAST_BUILD_INCREMENTAL is taken from buildbot if available;
479 # otherwise, a dev string is used.
480 '-e', 'CAST_BUILD_INCREMENTAL="<!(echo ${CAST_BUILD_INCREMENTAL:="<!(date +%Y%m%d.%H%M%S)"})"',
481 # CAST_BUILD_RELEASE is taken from cast_build_release file if exist;
482 # otherwise, a dev string is used.
483 '-e', 'CAST_BUILD_RELEASE="<!(if test -f <(cast_build_release); then cat <(cast_build_release); else echo eng.${USER}; fi)"',
484 '-e', 'CAST_IS_DEBUG_BUILD=1 if "<(CONFIGURATION_NAME)" == "Debug" or <(cast_is_debug_build) == 1 else 0',
485 '-e', 'CAST_PRODUCT_TYPE=<(cast_product_type)',
490 '../build/util/version.gypi',
497 # Targets for Android receiver.
502 'target_name': 'cast_shell_icudata',
505 '../third_party/icu/icu.gyp:icudata',
506 '../v8/tools/gyp/v8.gyp:v8_external_snapshot',
509 'destination': '<(PRODUCT_DIR)/assets',
511 '<(PRODUCT_DIR)/icudtl.dat',
512 '<(PRODUCT_DIR)/natives_blob.bin',
513 '<(PRODUCT_DIR)/snapshot_blob.bin',
518 'target_name': 'libcast_shell_android',
519 'type': 'shared_library',
523 'cast_shell_icudata',
525 'cast_version_header',
526 '../base/base.gyp:base',
527 '../components/components.gyp:breakpad_host',
528 '../content/content.gyp:content',
529 '../skia/skia.gyp:skia',
530 '../ui/gfx/gfx.gyp:gfx',
531 '../ui/gl/gl.gyp:gl',
534 'android/cast_jni_registrar.cc',
535 'android/cast_jni_registrar.h',
536 'android/cast_metrics_helper_android.cc',
537 'android/cast_metrics_helper_android.h',
538 'android/platform_jni_loader.h',
539 'app/android/cast_jni_loader.cc',
542 ['chromecast_branding!="public"', {
544 'internal/chromecast_internal.gyp:cast_shell_android_internal'
548 'android/platform_jni_loader_stub.cc',
552 }, # end of target 'libcast_shell_android'
554 'target_name': 'cast_base_java',
557 '../base/base.gyp:base_java',
560 'android_manifest_path': 'android/AndroidManifest.xml',
561 'java_in_dir': 'base/java',
563 'includes': ['../build/java.gypi'],
564 }, # end of target 'cast_base_java'
566 'target_name': 'cast_shell_java',
569 '<(android_support_v13_target)',
571 'cast_shell_manifest',
572 '../base/base.gyp:base_java',
573 '../components/components.gyp:external_video_surface_java',
574 '../content/content.gyp:content_java',
575 '../media/media.gyp:media_java',
576 '../net/net.gyp:net_java',
577 '../ui/android/ui_android.gyp:ui_java',
580 'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
581 'has_java_resources': 1,
582 'java_in_dir': 'browser/android/apk',
583 'resource_dir': 'browser/android/apk/res',
584 'R_package': 'org.chromium.chromecast.shell',
586 'includes': ['../build/java.gypi'],
587 }, # end of target 'cast_shell_java'
589 'target_name': 'cast_shell_manifest',
592 'jinja_inputs': ['browser/android/apk/AndroidManifest.xml.jinja2'],
593 'jinja_output': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
595 'includes': [ '../build/android/jinja_template.gypi' ],
598 'target_name': 'cast_shell_apk',
602 'libcast_shell_android',
605 'apk_name': 'CastShell',
606 'manifest_package_name': 'org.chromium.chromecast.shell',
607 # Note(gunsch): there are no Java files in the android/ directory.
608 # Unfortunately, the java_apk.gypi target rigidly insists on having
609 # a java_in_dir directory, but complains about duplicate classes
610 # from the common cast_shell_java target (shared with internal APK)
611 # if the actual Java path is used.
612 # This will hopefully be removable after the great GN migration.
613 'java_in_dir': 'android',
614 'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
615 'package_name': 'org.chromium.chromecast.shell',
616 'native_lib_target': 'libcast_shell_android',
617 'asset_location': '<(PRODUCT_DIR)/assets',
618 'additional_input_paths': ['<(PRODUCT_DIR)/assets/cast_shell.pak'],
620 'includes': [ '../build/java_apk.gypi' ],
623 'target_name': 'cast_jni_headers',
626 'base/java/src/org/chromium/chromecast/base/ChromecastConfigAndroid.java',
627 'base/java/src/org/chromium/chromecast/base/DumpstateWriter.java',
628 'base/java/src/org/chromium/chromecast/base/SystemTimeChangeNotifierAndroid.java',
629 'browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java',
630 'browser/android/apk/src/org/chromium/chromecast/shell/CastMetricsHelper.java',
631 'browser/android/apk/src/org/chromium/chromecast/shell/CastSysInfoAndroid.java',
632 'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java',
633 'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowManager.java',
635 'direct_dependent_settings': {
637 '<(SHARED_INTERMEDIATE_DIR)/chromecast',
641 'jni_gen_package': 'chromecast',
643 'includes': [ '../build/jni_generator.gypi' ],
646 }, { # OS != "android"
649 'target_name': 'cast_shell_media',
650 'type': '<(component)',
653 'media/media.gyp:cast_media',
654 '../content/content.gyp:content',
655 '../ipc/ipc.gyp:ipc',
656 '../media/media.gyp:media',
659 'browser/media/cast_browser_cdm_factory.cc',
660 'browser/media/cast_browser_cdm_factory.h',
661 'browser/media/cma_message_filter_host.cc',
662 'browser/media/cma_message_filter_host.h',
663 'browser/media/media_pipeline_host.cc',
664 'browser/media/media_pipeline_host.h',
665 'common/media/cma_ipc_common.h',
666 'common/media/cma_messages.h',
667 'common/media/cma_message_generator.cc',
668 'common/media/cma_message_generator.h',
669 'common/media/cma_param_traits.cc',
670 'common/media/cma_param_traits.h',
671 'common/media/shared_memory_chunk.cc',
672 'common/media/shared_memory_chunk.h',
673 'renderer/media/audio_pipeline_proxy.cc',
674 'renderer/media/audio_pipeline_proxy.h',
675 'renderer/media/chromecast_media_renderer_factory.cc',
676 'renderer/media/chromecast_media_renderer_factory.h',
677 'renderer/media/cma_message_filter_proxy.cc',
678 'renderer/media/cma_message_filter_proxy.h',
679 'renderer/media/media_channel_proxy.cc',
680 'renderer/media/media_channel_proxy.h',
681 'renderer/media/media_pipeline_proxy.cc',
682 'renderer/media/media_pipeline_proxy.h',
683 'renderer/media/video_pipeline_proxy.cc',
684 'renderer/media/video_pipeline_proxy.h',
686 }, # end of target 'cast_shell_media'
687 # This target contains all of the primary code of |cast_shell|, except
688 # for |main|. This allows end-to-end tests using |cast_shell|.
689 # This also includes all targets that cannot be built on Android.
691 'target_name': 'cast_shell_core',
692 'type': '<(component)',
696 'media/media.gyp:cast_media',
699 ['ozone_platform_egltest==1', {
701 '../ui/ozone/ozone.gyp:eglplatform_shim_x11',
707 'target_name': 'cast_shell',
708 'type': 'executable',
716 # Allow OEMs to override default libraries that are shipped with
717 # cast receiver package by installed OEM-specific libraries in
719 '-Wl,-rpath=/oem_cast_shlib',
720 # TODO(dougsteed): remove when Chromecast moves to boringssl.
721 # Allow the cast shell to find the NSS module in the same
723 '-Wl,-rpath=\$$ORIGIN'
728 ['enable_default_cast_graphics==1', {
731 'target_name': 'libcast_graphics_1.0',
732 'type': 'shared_library',
737 'graphics/cast_egl_platform_default.cc',
738 'graphics/graphics_properties_default.cc',
739 'graphics/osd_plane_default.cc'
744 ], # end of conditions