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