Factorize media/audio into new GN.
[chromium-blink-merge.git] / mojo / mojo.gyp
blob1a998af6933eb4b85b3974dc64b58b0957787ae5
1 # Copyright 2013 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   'target_defaults': {
7     'conditions': [
8       ['mojo_shell_debug_url != ""', {
9         'defines': [
10           'MOJO_SHELL_DEBUG=1',
11           'MOJO_SHELL_DEBUG_URL="<(mojo_shell_debug_url)"',
12          ],
13       }],
14     ],
15   },
16   'variables': {
17     'chromium_code': 1,
18     'mojo_shell_debug_url%': "",
19     'conditions': [
20       #
21       # The following mojo_system-prefixed variables are used to express a
22       # dependency on the mojo system APIs.
23       #
24       # In a component == "shared_library" build, everything can link against
25       # mojo_system_impl because it is built as a shared library. However, in a
26       # component != "shared_library" build, mojo_system_impl is linked into an
27       # executable (e.g., mojo_shell), and must be injected into other shared
28       # libraries (i.e., Mojo Apps) that need the mojo system API.
29       #
30       # For component targets, add <(mojo_system_for_component) to your
31       # dependencies section.  For loadable module targets (e.g., a Mojo App),
32       # add <(mojo_system_for_loadable_module) to your dependencies section.
33       #
34       # NOTE: component != "shared_library" implies that we are generating a
35       # static library, and in that case, it is expected that the target
36       # listing the component as a dependency will specify either mojo_system
37       # or mojo_system_impl to link against. This enables multiple targets to
38       # link against the same component library without having to agree on
39       # which Mojo system library they are using.
40       #
41       ['component=="shared_library"', {
42         'mojo_system_for_component': "mojo_system_impl",
43         'mojo_system_for_loadable_module': "mojo_system_impl",
44       }, {
45         'mojo_system_for_component': "mojo_none",
46         'mojo_system_for_loadable_module': "mojo_system",
47       }],
48     ],
49   },
50   'includes': [
51     'mojo_apps.gypi',
52     'mojo_examples.gypi',
53     'mojo_public.gypi',
54     'mojo_public_tests.gypi',
55     'mojo_services.gypi',
56   ],
57   'targets': [
58     {
59       'target_name': 'mojo',
60       'type': 'none',
61       'dependencies': [
62         'mojo_apps_js_unittests',
63         'mojo_compositor_app',
64         'mojo_common_lib',
65         'mojo_common_unittests',
66         'mojo_cpp_bindings',
67         'mojo_geometry_lib',
68         'mojo_html_viewer',
69         'mojo_js',
70         'mojo_js_bindings',
71         'mojo_js_unittests',
72         'mojo_launcher',
73         'mojo_message_generator',
74         'mojo_native_viewport_service',
75         'mojo_network_service',
76         'mojo_pepper_container_app',
77         'mojo_png_viewer',
78         'mojo_public_application_unittests',
79         'mojo_public_test_utils',
80         'mojo_public_bindings_unittests',
81         'mojo_public_environment_unittests',
82         'mojo_public_system_perftests',
83         'mojo_public_system_unittests',
84         'mojo_public_utility_unittests',
85         'mojo_sample_app',
86         'mojo_service_manager',
87         'mojo_service_manager_unittests',
88         'mojo_shell',
89         'mojo_shell_lib',
90         'mojo_shell_tests',
91         'mojo_surfaces_app',
92         'mojo_surfaces_child_app',
93         'mojo_surfaces_lib',
94         'mojo_surfaces_lib_unittests',
95         'mojo_surfaces_app',
96         'mojo_surfaces_service',
97         'mojo_system',
98         'mojo_system_impl',
99         'mojo_system_unittests',
100         'mojo_test_app',
101         'mojo_test_request_tracker_app',
102         'mojo_utility',
103         'mojo_view_manager_lib',
104         'mojo_view_manager_lib_unittests',
105         'mojo_wget',
106       ],
107       'conditions': [
108         ['use_aura==1', {
109           'dependencies': [
110             'mojo_aura_demo',
111             'mojo_aura_demo_init',
112             'mojo_browser',
113             'mojo_core_window_manager',
114             'mojo_core_window_manager_unittests',
115             'mojo_demo_launcher',
116             'mojo_embedded_app',
117             'mojo_keyboard',
118             'mojo_media_viewer',
119             'mojo_nesting_app',
120             'mojo_window_manager',
121             'mojo_view_manager',
122             'mojo_view_manager_unittests',
123           ],
124         }],
125         ['OS == "android"', {
126           'dependencies': [
127             'mojo_bindings_java',
128             'mojo_public_java',
129             'mojo_system_java',
130             'libmojo_system_java',
131             'mojo_test_apk',
132           ],
133         }],
134         ['OS == "linux"', {
135           'dependencies': [
136             'mojo_dbus_echo',
137             'mojo_dbus_echo_service',
138           ],
139         }],
140       ]
141     },
142     {
143       'target_name': 'mojo_none',
144       'type': 'none',
145     },
146     {
147       'target_name': 'mojo_external_service_bindings',
148       'type': 'static_library',
149       'sources': [
150         'shell/external_service.mojom',
151       ],
152       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
153       'export_dependent_settings': [
154         'mojo_cpp_bindings',
155       ],
156       'dependencies': [
157         'mojo_cpp_bindings',
158       ],
159     },
160     {
161       'target_name': 'mojo_run_all_unittests',
162       'type': 'static_library',
163       'dependencies': [
164         '../base/base.gyp:base',
165         '../base/base.gyp:test_support_base',
166         '../testing/gtest.gyp:gtest',
167         'mojo_system_impl',
168         'mojo_test_support',
169         'mojo_test_support_impl',
170       ],
171       'sources': [
172         'common/test/run_all_unittests.cc',
173       ],
174     },
175     {
176       'target_name': 'mojo_run_all_perftests',
177       'type': 'static_library',
178       'dependencies': [
179         '../base/base.gyp:test_support_base',
180         'mojo_system_impl',
181         'mojo_test_support',
182         'mojo_test_support_impl',
183       ],
184       'sources': [
185         'common/test/run_all_perftests.cc',
186       ],
187     },
188     {
189       # GN version: //mojo/system
190       'target_name': 'mojo_system_impl',
191       'type': '<(component)',
192       'dependencies': [
193         '../base/base.gyp:base',
194         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
195       ],
196       'defines': [
197         'MOJO_SYSTEM_IMPL_IMPLEMENTATION',
198         'MOJO_SYSTEM_IMPLEMENTATION',
199         'MOJO_USE_SYSTEM_IMPL',
200       ],
201       'sources': [
202         'embedder/channel_init.cc',
203         'embedder/channel_init.h',
204         'embedder/embedder.cc',
205         'embedder/embedder.h',
206         'embedder/platform_channel_pair.cc',
207         'embedder/platform_channel_pair.h',
208         'embedder/platform_channel_pair_posix.cc',
209         'embedder/platform_channel_pair_win.cc',
210         'embedder/platform_channel_utils_posix.cc',
211         'embedder/platform_channel_utils_posix.h',
212         'embedder/platform_handle.cc',
213         'embedder/platform_handle.h',
214         'embedder/platform_handle_utils.h',
215         'embedder/platform_handle_utils_posix.cc',
216         'embedder/platform_handle_utils_win.cc',
217         'embedder/platform_handle_vector.h',
218         'embedder/scoped_platform_handle.h',
219         'system/channel.cc',
220         'system/channel.h',
221         'system/constants.h',
222         'system/core.cc',
223         'system/core.h',
224         'system/data_pipe.cc',
225         'system/data_pipe.h',
226         'system/data_pipe_consumer_dispatcher.cc',
227         'system/data_pipe_consumer_dispatcher.h',
228         'system/data_pipe_producer_dispatcher.cc',
229         'system/data_pipe_producer_dispatcher.h',
230         'system/dispatcher.cc',
231         'system/dispatcher.h',
232         'system/entrypoints.cc',
233         'system/handle_signals_state.h',
234         'system/handle_table.cc',
235         'system/handle_table.h',
236         'system/local_data_pipe.cc',
237         'system/local_data_pipe.h',
238         'system/local_message_pipe_endpoint.cc',
239         'system/local_message_pipe_endpoint.h',
240         'system/mapping_table.cc',
241         'system/mapping_table.h',
242         'system/memory.cc',
243         'system/memory.h',
244         'system/message_in_transit.cc',
245         'system/message_in_transit.h',
246         'system/message_in_transit_queue.cc',
247         'system/message_in_transit_queue.h',
248         'system/message_pipe.cc',
249         'system/message_pipe.h',
250         'system/message_pipe_dispatcher.cc',
251         'system/message_pipe_dispatcher.h',
252         'system/message_pipe_endpoint.cc',
253         'system/message_pipe_endpoint.h',
254         'system/options_validation.h',
255         'system/platform_handle_dispatcher.cc',
256         'system/platform_handle_dispatcher.h',
257         'system/proxy_message_pipe_endpoint.cc',
258         'system/proxy_message_pipe_endpoint.h',
259         'system/raw_channel.cc',
260         'system/raw_channel.h',
261         'system/raw_channel_posix.cc',
262         'system/raw_channel_win.cc',
263         'system/raw_shared_buffer.cc',
264         'system/raw_shared_buffer.h',
265         'system/raw_shared_buffer_posix.cc',
266         'system/raw_shared_buffer_win.cc',
267         'system/shared_buffer_dispatcher.cc',
268         'system/shared_buffer_dispatcher.h',
269         'system/simple_dispatcher.cc',
270         'system/simple_dispatcher.h',
271         'system/transport_data.cc',
272         'system/transport_data.h',
273         'system/waiter.cc',
274         'system/waiter.h',
275         'system/waiter_list.cc',
276         'system/waiter_list.h',
277         # Test-only code:
278         # TODO(vtl): It's a little unfortunate that these end up in the same
279         # component as non-test-only code. In the static build, this code should
280         # hopefully be dead-stripped.
281         'embedder/test_embedder.cc',
282         'embedder/test_embedder.h',
283       ],
284       'all_dependent_settings': {
285         # Ensures that dependent projects import the core functions on Windows.
286         'defines': ['MOJO_USE_SYSTEM_IMPL'],
287       }
288     },
289     {
290       'target_name': 'mojo_system_unittests',
291       'type': 'executable',
292       'dependencies': [
293         '../base/base.gyp:base',
294         '../base/base.gyp:run_all_unittests',
295         '../testing/gtest.gyp:gtest',
296         'mojo_common_test_support',
297         'mojo_system_impl',
298       ],
299       'sources': [
300         'embedder/embedder_unittest.cc',
301         'embedder/platform_channel_pair_posix_unittest.cc',
302         'system/channel_unittest.cc',
303         'system/core_unittest.cc',
304         'system/core_test_base.cc',
305         'system/core_test_base.h',
306         'system/data_pipe_unittest.cc',
307         'system/dispatcher_unittest.cc',
308         'system/local_data_pipe_unittest.cc',
309         'system/memory_unittest.cc',
310         'system/message_pipe_dispatcher_unittest.cc',
311         'system/message_pipe_unittest.cc',
312         'system/multiprocess_message_pipe_unittest.cc',
313         'system/options_validation_unittest.cc',
314         'system/platform_handle_dispatcher_unittest.cc',
315         'system/raw_channel_unittest.cc',
316         'system/raw_shared_buffer_unittest.cc',
317         'system/remote_message_pipe_unittest.cc',
318         'system/shared_buffer_dispatcher_unittest.cc',
319         'system/simple_dispatcher_unittest.cc',
320         'system/test_utils.cc',
321         'system/test_utils.h',
322         'system/waiter_list_unittest.cc',
323         'system/waiter_test_utils.cc',
324         'system/waiter_test_utils.h',
325         'system/waiter_unittest.cc',
326       ],
327     },
328     {
329       'target_name': 'mojo_gles2_impl',
330       'type': '<(component)',
331       'dependencies': [
332         '../base/base.gyp:base',
333         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
334         '../gpu/gpu.gyp:command_buffer_client',
335         '../gpu/gpu.gyp:command_buffer_common',
336         '../gpu/gpu.gyp:gles2_cmd_helper',
337         '../gpu/gpu.gyp:gles2_implementation',
338         'mojo_gles2',
339         'mojo_gles2_bindings',
340         'mojo_environment_chromium',
341         '<(mojo_system_for_component)',
342       ],
343       'defines': [
344         'MOJO_GLES2_IMPL_IMPLEMENTATION',
345       ],
346       'sources': [
347         'gles2/command_buffer_client_impl.cc',
348         'gles2/command_buffer_client_impl.h',
349         'gles2/gles2_impl_export.h',
350         'gles2/gles2_support_impl.cc',
351         'gles2/gles2_support_impl.h',
352         'gles2/gles2_context.cc',
353         'gles2/gles2_context.h',
354       ],
355     },
356     {
357       'target_name': 'mojo_test_support_impl',
358       'type': 'static_library',
359       'dependencies': [
360         '../base/base.gyp:base',
361       ],
362       'sources': [
363         'common/test/test_support_impl.cc',
364         'common/test/test_support_impl.h',
365       ],
366     },
367     {
368       # GN version: //mojo/common
369       'target_name': 'mojo_common_lib',
370       'type': '<(component)',
371       'defines': [
372         'MOJO_COMMON_IMPLEMENTATION',
373       ],
374       'dependencies': [
375         '../base/base.gyp:base',
376         '../url/url.gyp:url_lib',
377         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
378         '<(mojo_system_for_component)',
379       ],
380       'export_dependent_settings': [
381         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
382       ],
383       'sources': [
384         'common/common_type_converters.cc',
385         'common/common_type_converters.h',
386         'common/data_pipe_utils.cc',
387         'common/data_pipe_utils.h',
388         'common/handle_watcher.cc',
389         'common/handle_watcher.h',
390         'common/message_pump_mojo.cc',
391         'common/message_pump_mojo.h',
392         'common/message_pump_mojo_handler.h',
393         'common/time_helper.cc',
394         'common/time_helper.h',
395       ],
396     },
397     {
398       'target_name': 'mojo_common_test_support',
399       'type': 'static_library',
400       'dependencies': [
401         '../base/base.gyp:base',
402         '../base/base.gyp:test_support_base',
403         '../testing/gtest.gyp:gtest',
404         'mojo_system_impl',
405       ],
406       'sources': [
407         'common/test/multiprocess_test_helper.cc',
408         'common/test/multiprocess_test_helper.h',
409         'common/test/test_utils.h',
410         'common/test/test_utils_posix.cc',
411         'common/test/test_utils_win.cc',
412       ],
413     },
414     {
415       'target_name': 'mojo_common_unittests',
416       'type': 'executable',
417       'dependencies': [
418         '../base/base.gyp:base',
419         '../base/base.gyp:base_message_loop_tests',
420         '../testing/gtest.gyp:gtest',
421         '../url/url.gyp:url_lib',
422         'mojo_cpp_bindings',
423         'mojo_environment_chromium',
424         'mojo_common_lib',
425         'mojo_common_test_support',
426         'mojo_public_test_utils',
427         'mojo_run_all_unittests',
428       ],
429       'sources': [
430         'common/common_type_converters_unittest.cc',
431         'common/handle_watcher_unittest.cc',
432         'common/message_pump_mojo_unittest.cc',
433         'common/test/multiprocess_test_helper_unittest.cc',
434       ],
435     },
436     {
437       # GN version: //mojo/environment:chromium
438       'target_name': 'mojo_environment_chromium',
439       'type': 'static_library',
440       'dependencies': [
441         'mojo_environment_chromium_impl',
442       ],
443       'sources': [
444         'environment/environment.cc',
445         # TODO(vtl): This is kind of ugly. (See TODO in logging.h.)
446         "public/cpp/environment/logging.h",
447         "public/cpp/environment/lib/logging.cc",
448       ],
449       'include_dirs': [
450         '..',
451       ],
452       'export_dependent_settings': [
453         'mojo_environment_chromium_impl',
454       ],
455     },
456     {
457       # GN version: //mojo/environment:chromium_impl
458       'target_name': 'mojo_environment_chromium_impl',
459       'type': '<(component)',
460       'defines': [
461         'MOJO_ENVIRONMENT_IMPL_IMPLEMENTATION',
462       ],
463       'dependencies': [
464         '../base/base.gyp:base',
465         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
466         'mojo_common_lib',
467         '<(mojo_system_for_component)',
468       ],
469       'sources': [
470         'environment/default_async_waiter_impl.cc',
471         'environment/default_async_waiter_impl.h',
472         'environment/default_logger_impl.cc',
473         'environment/default_logger_impl.h',
474       ],
475       'include_dirs': [
476         '..',
477       ],
478     },
479     {
480       # GN version: //mojo/service_manager
481       'target_name': 'mojo_service_manager',
482       'type': '<(component)',
483       'defines': [
484         'MOJO_SERVICE_MANAGER_IMPLEMENTATION',
485       ],
486       'dependencies': [
487         '../base/base.gyp:base',
488         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
489         '../net/net.gyp:net',
490         '../url/url.gyp:url_lib',
491         'mojo_common_lib',
492         'mojo_environment_chromium',
493         'mojo_service_provider_bindings',
494         '<(mojo_system_for_component)',
495       ],
496       'sources': [
497         'service_manager/background_service_loader.cc',
498         'service_manager/background_service_loader.h',
499         'service_manager/service_loader.h',
500         'service_manager/service_manager.cc',
501         'service_manager/service_manager.h',
502         'service_manager/service_manager_export.h',
503       ],
504       'export_dependent_settings': [
505         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
506         'mojo_service_provider_bindings',
507       ],
508     },
509     {
510       'target_name': 'mojo_spy',
511       'type': 'static_library',
512       'dependencies': [
513         '../base/base.gyp:base',
514         '../base/base.gyp:base_static',
515         '../net/net.gyp:http_server',
516         '../url/url.gyp:url_lib',
517         'mojo_service_manager',
518       ],
519       'variables': {
520         'mojom_base_output_dir': 'mojo',
521       },
522       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
523       'sources': [
524         'spy/public/spy.mojom',
525         'spy/common.h',
526         'spy/spy.cc',
527         'spy/spy.h',
528         'spy/spy_server_impl.h',
529         'spy/spy_server_impl.cc',
530         'spy/websocket_server.cc',
531         'spy/websocket_server.h',
532       ],
533     },
534     {
535       'target_name': 'mojo_shell_lib',
536       'type': 'static_library',
537       'dependencies': [
538         '../base/base.gyp:base',
539         '../base/base.gyp:base_static',
540         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
541         '../net/net.gyp:net',
542         '../url/url.gyp:url_lib',
543         'mojo_application',
544         'mojo_common_lib',
545         'mojo_external_service_bindings',
546         'mojo_gles2_impl',
547         'mojo_native_viewport_service',
548         'mojo_network_bindings',
549         'mojo_service_manager',
550         'mojo_service_provider_bindings',
551         'mojo_spy',
552         'mojo_system_impl',
553       ],
554       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
555       'sources': [
556         'shell/app_child_process.cc',
557         'shell/app_child_process.h',
558         'shell/app_child_process.mojom',
559         'shell/app_child_process_host.cc',
560         'shell/app_child_process_host.h',
561         'shell/child_process.cc',
562         'shell/child_process.h',
563         'shell/child_process_host.cc',
564         'shell/child_process_host.h',
565         'shell/context.cc',
566         'shell/context.h',
567         'shell/dbus_service_loader_linux.cc',
568         'shell/dbus_service_loader_linux.h',
569         'shell/dynamic_service_loader.cc',
570         'shell/dynamic_service_loader.h',
571         'shell/dynamic_service_runner.h',
572         'shell/init.cc',
573         'shell/init.h',
574         'shell/in_process_dynamic_service_runner.cc',
575         'shell/in_process_dynamic_service_runner.h',
576         'shell/keep_alive.cc',
577         'shell/keep_alive.h',
578         'shell/mojo_url_resolver.cc',
579         'shell/mojo_url_resolver.h',
580         'shell/out_of_process_dynamic_service_runner.cc',
581         'shell/out_of_process_dynamic_service_runner.h',
582         'shell/run.cc',
583         'shell/run.h',
584         'shell/switches.cc',
585         'shell/switches.h',
586         'shell/task_runners.cc',
587         'shell/task_runners.h',
588         'shell/test_child_process.cc',
589         'shell/test_child_process.h',
590         'shell/ui_service_loader_android.cc',
591         'shell/ui_service_loader_android.h',
592         'shell/view_manager_loader.cc',
593         'shell/view_manager_loader.h',
594       ],
595       'conditions': [
596         ['OS=="linux"', {
597           'dependencies': [
598             '../build/linux/system.gyp:dbus',
599             '../dbus/dbus.gyp:dbus',
600           ],
601         }],
602         ['OS=="android"', {
603           'dependencies': [
604             'mojo_network_service_lib',
605           ],
606           'sources': [
607             'shell/network_service_loader.cc',
608             'shell/network_service_loader.h',
609           ],
610         }],
611         ['use_aura==1', {
612           'dependencies': [
613             # These are only necessary as long as we hard code use of ViewManager.
614             '../skia/skia.gyp:skia',
615             'mojo_gles2',
616             'mojo_view_manager',
617             'mojo_view_manager_bindings',
618           ],
619         }, {  # use_aura==0
620           'sources!': [
621             'shell/view_manager_loader.cc',
622             'shell/view_manager_loader.h',
623           ],
624         }],
625       ],
626     },
627     {
628       'target_name': 'mojo_shell_test_support',
629       'type': 'static_library',
630       'dependencies': [
631         '../base/base.gyp:base',
632         '../base/base.gyp:base_static',
633         '../url/url.gyp:url_lib',
634         'mojo_service_manager',
635         'mojo_shell_lib',
636         'mojo_system_impl',
637       ],
638       'sources': [
639         'shell/shell_test_helper.cc',
640         'shell/shell_test_helper.h',
641       ],
642     },
643     {
644       'target_name': 'mojo_shell',
645       'type': 'executable',
646       'dependencies': [
647         '../base/base.gyp:base',
648         '../ui/gl/gl.gyp:gl',
649         '../url/url.gyp:url_lib',
650         'mojo_common_lib',
651         'mojo_environment_chromium',
652         'mojo_service_manager',
653         'mojo_shell_lib',
654         'mojo_system_impl',
655       ],
656       'conditions': [
657         ['use_ozone==1', {
658           'dependencies': [
659             '../ui/ozone/ozone.gyp:ozone',
660           ],
661         }],
662       ],
663       'sources': [
664         'shell/desktop/mojo_main.cc',
665       ],
666     },
667     {
668       'target_name': 'mojo_shell_tests',
669       'type': '<(gtest_target_type)',
670       'dependencies': [
671         '../base/base.gyp:base',
672         '../base/base.gyp:base_i18n',
673         '../base/base.gyp:test_support_base',
674         '../testing/gtest.gyp:gtest',
675         # TODO(vtl): We don't currently need this, but I imagine we will soon.
676         # '../ui/gl/gl.gyp:gl',
677         '../url/url.gyp:url_lib',
678         'mojo_common_lib',
679         'mojo_environment_chromium',
680         'mojo_service_manager',
681         'mojo_shell_lib',
682         'mojo_system_impl',
683         'mojo_test_app',
684         'mojo_test_request_tracker_app',
685         'mojo_test_service_bindings',
686       ],
687       'sources': [
688         'shell/child_process_host_unittest.cc',
689         'shell/shell_test_base.cc',
690         'shell/shell_test_base.h',
691         'shell/shell_test_base_unittest.cc',
692         'shell/shell_test_main.cc',
693       ],
694       'conditions': [
695         ['OS == "android"', {
696           'dependencies': [
697             '../testing/android/native_test.gyp:native_test_native_code',
698           ],
699         }],
700       ],
701     },
702     {
703       'target_name': 'mojo_service_manager_unittests',
704       'type': 'executable',
705       'dependencies': [
706         '../base/base.gyp:base',
707         '../testing/gtest.gyp:gtest',
708         '../url/url.gyp:url_lib',
709         'mojo_common_lib',
710         'mojo_cpp_bindings',
711         'mojo_environment_chromium',
712         'mojo_run_all_unittests',
713         'mojo_service_manager',
714         'mojo_application',
715       ],
716       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
717       'sources': [
718         'service_manager/service_manager_unittest.cc',
719         'service_manager/test.mojom',
720       ],
721     },
722     {
723       'target_name': 'mojo_js_bindings_lib',
724       'type': 'static_library',
725       'dependencies': [
726         '../base/base.gyp:base',
727         '../gin/gin.gyp:gin',
728         '../v8/tools/gyp/v8.gyp:v8',
729         'mojo_common_lib',
730       ],
731       'export_dependent_settings': [
732         '../base/base.gyp:base',
733         '../gin/gin.gyp:gin',
734         'mojo_common_lib',
735       ],
736       'sources': [
737         'bindings/js/core.cc',
738         'bindings/js/core.h',
739         'bindings/js/handle.cc',
740         'bindings/js/handle.h',
741         'bindings/js/support.cc',
742         'bindings/js/support.h',
743         'bindings/js/waiting_callback.cc',
744         'bindings/js/waiting_callback.h',
745       ],
746     },
747     {
748       'target_name': 'mojo_js_unittests',
749       'type': 'executable',
750       'dependencies': [
751         '../gin/gin.gyp:gin_test',
752         'mojo_common_test_support',
753         'mojo_js_bindings_lib',
754         'mojo_run_all_unittests',
755         'mojo_public_test_interfaces',
756       ],
757       'sources': [
758         'bindings/js/run_js_tests.cc',
759       ],
760     },
761     {
762       'target_name': 'mojo_message_generator',
763       'type': 'executable',
764       'dependencies': [
765         '../base/base.gyp:base',
766         '../testing/gtest.gyp:gtest',
767         'mojo_common_lib',
768         'mojo_cpp_bindings',
769         'mojo_environment_chromium',
770         'mojo_system_impl',
771       ],
772       'sources': [
773         'tools/message_generator.cc',
774       ],
775     },
776     {
777       'target_name': 'mojo_cc_support',
778       'type': 'static_library',
779       'dependencies': [
780         '../base/base.gyp:base',
781         '../cc/cc.gyp:cc',
782         '../skia/skia.gyp:skia',
783         '../gpu/gpu.gyp:gles2_implementation',
784         'mojo_gles2',
785       ],
786       'sources': [
787         'cc/context_provider_mojo.cc',
788         'cc/context_provider_mojo.h',
789       ],
790     },
791   ],
792   'conditions': [
793     ['OS=="android"', {
794       'targets': [
795         {
796           'target_name': 'mojo_jni_headers',
797           'type': 'none',
798           'dependencies': [
799             'mojo_java_set_jni_headers',
800           ],
801           'sources': [
802             'android/javatests/src/org/chromium/mojo/MojoTestCase.java',
803             'android/system/src/org/chromium/mojo/system/impl/CoreImpl.java',
804             'services/native_viewport/android/src/org/chromium/mojo/NativeViewportAndroid.java',
805             'shell/android/apk/src/org/chromium/mojo_shell_apk/MojoMain.java',
806           ],
807           'variables': {
808             'jni_gen_package': 'mojo',
809          },
810           'includes': [ '../build/jni_generator.gypi' ],
811         },
812         {
813           'target_name': 'mojo_system_java',
814           'type': 'none',
815           'dependencies': [
816             '../base/base.gyp:base_java',
817             'mojo_public_java',
818           ],
819           'variables': {
820             'java_in_dir': '<(DEPTH)/mojo/android/system',
821           },
822           'includes': [ '../build/java.gypi' ],
823         },
824         {
825           'target_name': 'libmojo_system_java',
826           'type': 'static_library',
827           'dependencies': [
828             '../base/base.gyp:base',
829             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
830             'mojo_common_lib',
831             'mojo_environment_chromium',
832             'mojo_jni_headers',
833             'mojo_service_provider_bindings',
834             'mojo_shell_lib',
835           ],
836           'sources': [
837             'android/system/core_impl.cc',
838             'android/system/core_impl.h',
839           ],
840         },
841         {
842           'target_name': 'libmojo_java_unittest',
843           'type': 'shared_library',
844           'dependencies': [
845             '../base/base.gyp:base',
846             '../base/base.gyp:test_support_base',
847             'libmojo_system_java',
848             'mojo_jni_headers',
849           ],
850           'defines': [
851             'UNIT_TEST'  # As exported from testing/gtest.gyp:gtest.
852           ],
853           'sources': [
854             'android/javatests/mojo_test_case.cc',
855             'android/javatests/mojo_test_case.h',
856             'android/javatests/init_library.cc',
857           ],
858         },
859         {
860           'target_name': 'mojo_test_apk',
861           'type': 'none',
862           'dependencies': [
863             'mojo_bindings_java',
864             'mojo_public_test_interfaces',
865             'mojo_system_java',
866             '../base/base.gyp:base_java_test_support',
867           ],
868           'variables': {
869             'apk_name': 'MojoTest',
870             'java_in_dir': '<(DEPTH)/mojo/android/javatests',
871             'resource_dir': '<(DEPTH)/mojo/android/javatests/apk',
872             'native_lib_target': 'libmojo_java_unittest',
873             'is_test_apk': 1,
874             # Given that this apk tests itself, it needs to bring emma with it
875             # when instrumented.
876             'conditions': [
877               ['emma_coverage != 0', {
878                 'emma_instrument': 1,
879               }],
880             ],
881           },
882           'includes': [ '../build/java_apk.gypi' ],
883         },
884         {
885           'target_name': 'mojo_native_viewport_java',
886           'type': 'none',
887           'dependencies': [
888             '../base/base.gyp:base_java',
889           ],
890           'variables': {
891             'java_in_dir': '<(DEPTH)/mojo/services/native_viewport/android',
892           },
893           'includes': [ '../build/java.gypi' ],
894         },
895         {
896           'target_name': 'mojo_java_set_jni_headers',
897           'type': 'none',
898           'variables': {
899             'jni_gen_package': 'mojo',
900             'input_java_class': 'java/util/HashSet.class',
901           },
902           'includes': [ '../build/jar_file_jni_generator.gypi' ],
903         },
904         {
905           'target_name': 'libmojo_shell',
906           'type': 'shared_library',
907           'dependencies': [
908             '../base/base.gyp:base',
909             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
910             '../ui/gfx/gfx.gyp:gfx',
911             '../ui/gfx/gfx.gyp:gfx_geometry',
912             '../ui/gl/gl.gyp:gl',
913             'mojo_common_lib',
914             'mojo_environment_chromium',
915             'mojo_jni_headers',
916             'mojo_service_provider_bindings',
917             'mojo_shell_lib',
918           ],
919           'sources': [
920             'shell/android/library_loader.cc',
921             'shell/android/mojo_main.cc',
922             'shell/android/mojo_main.h',
923           ],
924         },
925         {
926           'target_name': 'mojo_shell_apk',
927           'type': 'none',
928           'dependencies': [
929             '../base/base.gyp:base_java',
930             '../net/net.gyp:net_java',
931             'mojo_native_viewport_java',
932             'libmojo_shell',
933           ],
934           'variables': {
935             'apk_name': 'MojoShell',
936             'java_in_dir': '<(DEPTH)/mojo/shell/android/apk',
937             'resource_dir': '<(DEPTH)/mojo/shell/android/apk/res',
938             'native_lib_target': 'libmojo_shell',
939           },
940           'includes': [ '../build/java_apk.gypi' ],
941         }
942       ],
943     }],
944     ['OS=="linux"', {
945       'targets': [
946         {
947           'target_name': 'mojo_dbus_service',
948           'type': 'static_library',
949           'dependencies': [
950             '../base/base.gyp:base',
951             '../build/linux/system.gyp:dbus',
952             '../dbus/dbus.gyp:dbus',
953             'mojo_common_lib',
954             'mojo_external_service_bindings',
955             'mojo_application',
956             'mojo_system_impl',
957           ],
958           'sources': [
959             'dbus/dbus_external_service.h',
960             'dbus/dbus_external_service.cc',
961           ],
962         },
963       ],
964     }],
965     ['test_isolation_mode != "noop"', {
966       'targets': [
967         {
968           'target_name': 'mojo_js_unittests_run',
969           'type': 'none',
970           'dependencies': [
971             'mojo_js_unittests',
972           ],
973           'includes': [
974             '../build/isolate.gypi',
975             'mojo_js_unittests.isolate',
976           ],
977           'sources': [
978             'mojo_js_unittests.isolate',
979           ],
980         },
981       ],
982     }],
983     ['use_aura==1', {
984       'targets': [
985         {
986           'target_name': 'mojo_aura_support',
987           'type': 'static_library',
988           'dependencies': [
989             '../cc/cc.gyp:cc',
990             '../ui/aura/aura.gyp:aura',
991             '../ui/compositor/compositor.gyp:compositor',
992             '../ui/events/events.gyp:events',
993             '../ui/events/events.gyp:events_base',
994             '../ui/gl/gl.gyp:gl',
995             '../webkit/common/gpu/webkit_gpu.gyp:webkit_gpu',
996             'mojo_cc_support',
997             'mojo_gles2',
998             'mojo_native_viewport_bindings',
999           ],
1000           'sources': [
1001             'aura/aura_init.cc',
1002             'aura/aura_init.h',
1003             'aura/context_factory_mojo.cc',
1004             'aura/context_factory_mojo.h',
1005             'aura/screen_mojo.cc',
1006             'aura/screen_mojo.h',
1007             'aura/window_tree_host_mojo.cc',
1008             'aura/window_tree_host_mojo.h',
1009             'aura/window_tree_host_mojo_delegate.h',
1010           ],
1011         },
1012         {
1013           'target_name': 'mojo_views_support',
1014           'type': 'static_library',
1015           'dependencies': [
1016             '../base/base.gyp:base',
1017             '../base/base.gyp:base_i18n',
1018             '../skia/skia.gyp:skia',
1019             '../skia/skia.gyp:skia',
1020             '../third_party/icu/icu.gyp:icui18n',
1021             '../third_party/icu/icu.gyp:icuuc',
1022             '../ui/aura/aura.gyp:aura',
1023             '../ui/base/ui_base.gyp:ui_base',
1024             '../ui/views/views.gyp:views',
1025             '../ui/wm/wm.gyp:wm',
1026             'mojo_aura_support',
1027             'mojo_views_support_internal',
1028           ],
1029           'sources': [
1030             'views/native_widget_view_manager.cc',
1031             'views/native_widget_view_manager.h',
1032             'views/views_init.cc',
1033             'views/views_init.h',
1034           ],
1035         },
1036         {
1037           'target_name': 'mojo_views_support_internal',
1038           'type': '<(component)',
1039           'dependencies': [
1040             '../base/base.gyp:base',
1041             '../base/base.gyp:base_i18n',
1042             '../base/base.gyp:base_static',
1043             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
1044             '../skia/skia.gyp:skia',
1045             '../skia/skia.gyp:skia',
1046             '../third_party/icu/icu.gyp:icui18n',
1047             '../third_party/icu/icu.gyp:icuuc',
1048             '../ui/base/ui_base.gyp:ui_base',
1049             '../ui/gfx/gfx.gyp:gfx',
1050           ],
1051           'sources': [
1052             'views/mojo_views_export.h',
1053             'views/views_init_internal.cc',
1054             'views/views_init_internal.h',
1055           ],
1056           'defines': [
1057             'MOJO_VIEWS_IMPLEMENTATION',
1058           ],
1059         },
1060       ],
1061     }],
1062   ],