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