[DevTools] Implement DevToolsManager::Observer which notifies about target updates.
[chromium-blink-merge.git] / mojo / mojo_base.gyp
blob9f1127a500e09cc72515c6956467bed9c04b8d85
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.
5 # Essential components (and their tests) that are needed to build
6 # Chrome should be here.  Other components that are useful only in
7 # Mojo land like mojo_shell should be in mojo.gyp.
9   'includes': [
10     'mojo_public.gypi',
11     'mojo_public_tests.gypi',
12     'mojo_variables.gypi',
13   ],
14   'targets': [
15     {
16       'target_name': 'mojo_base',
17       'type': 'none',
18       'dependencies': [
19         # NOTE: If adding a new dependency here, please consider whether it
20         # should also be added to the list of Mojo-related dependencies of
21         # build/all.gyp:All on iOS, as All cannot depend on the mojo_base
22         # target on iOS due to the presence of the js targets, which cause v8
23         # to be built.
24         'mojo_common_lib',
25         'mojo_common_unittests',
26         'mojo_cpp_bindings',
27         'mojo_js_bindings',
28         'mojo_js_unittests',
29         'mojo_message_generator',
30         'mojo_message_pipe_perftests',
31         'mojo_public_application_unittests',
32         'mojo_public_test_utils',
33         'mojo_public_bindings_unittests',
34         'mojo_public_environment_unittests',
35         'mojo_public_system_perftests',
36         'mojo_public_system_unittests',
37         'mojo_public_utility_unittests',
38         'mojo_system',
39         'mojo_system_impl',
40         'mojo_system_unittests',
41         'mojo_utility',
42       ],
43       'conditions': [
44         ['OS == "android"', {
45           'dependencies': [
46             'mojo_bindings_java',
47             'mojo_public_java',
48             'mojo_system_java',
49             'libmojo_system_java',
50             'mojo_test_apk',
51           ],
52         }],
53       ]
54     },
55     {
56       'target_name': 'mojo_none',
57       'type': 'none',
58     },
59     {
60       # GN version: //mojo/common/test:run_all_unittests
61       'target_name': 'mojo_run_all_unittests',
62       'type': 'static_library',
63       'dependencies': [
64         '../base/base.gyp:base',
65         '../base/base.gyp:test_support_base',
66         '../testing/gtest.gyp:gtest',
67         'mojo_system_impl',
68         'mojo_test_support',
69         'mojo_test_support_impl',
70       ],
71       'sources': [
72         'common/test/run_all_unittests.cc',
73       ],
74     },
75     {
76       # GN version: //mojo/common/test:run_all_perftests
77       'target_name': 'mojo_run_all_perftests',
78       'type': 'static_library',
79       'dependencies': [
80         '../base/base.gyp:test_support_base',
81         'mojo_system_impl',
82         'mojo_test_support',
83         'mojo_test_support_impl',
84       ],
85       'sources': [
86         'common/test/run_all_perftests.cc',
87       ],
88     },
89     {
90       # GN version: //mojo/system
91       'target_name': 'mojo_system_impl',
92       'type': '<(component)',
93       'dependencies': [
94         '../base/base.gyp:base',
95         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
96       ],
97       'defines': [
98         'MOJO_SYSTEM_IMPL_IMPLEMENTATION',
99         'MOJO_SYSTEM_IMPLEMENTATION',
100         'MOJO_USE_SYSTEM_IMPL',
101       ],
102       'sources': [
103         'embedder/channel_init.cc',
104         'embedder/channel_init.h',
105         'embedder/embedder.cc',
106         'embedder/embedder.h',
107         'embedder/platform_channel_pair.cc',
108         'embedder/platform_channel_pair.h',
109         'embedder/platform_channel_pair_posix.cc',
110         'embedder/platform_channel_pair_win.cc',
111         'embedder/platform_channel_utils_posix.cc',
112         'embedder/platform_channel_utils_posix.h',
113         'embedder/platform_handle.cc',
114         'embedder/platform_handle.h',
115         'embedder/platform_handle_utils.h',
116         'embedder/platform_handle_utils_posix.cc',
117         'embedder/platform_handle_utils_win.cc',
118         'embedder/platform_handle_vector.h',
119         'embedder/platform_shared_buffer.h',
120         'embedder/platform_support.h',
121         'embedder/scoped_platform_handle.h',
122         'embedder/simple_platform_shared_buffer.cc',
123         'embedder/simple_platform_shared_buffer.h',
124         'embedder/simple_platform_shared_buffer_posix.cc',
125         'embedder/simple_platform_shared_buffer_win.cc',
126         'embedder/simple_platform_support.cc',
127         'embedder/simple_platform_support.h',
128         'system/channel.cc',
129         'system/channel.h',
130         'system/channel_endpoint.cc',
131         'system/channel_endpoint.h',
132         'system/constants.h',
133         'system/core.cc',
134         'system/core.h',
135         'system/data_pipe.cc',
136         'system/data_pipe.h',
137         'system/data_pipe_consumer_dispatcher.cc',
138         'system/data_pipe_consumer_dispatcher.h',
139         'system/data_pipe_producer_dispatcher.cc',
140         'system/data_pipe_producer_dispatcher.h',
141         'system/dispatcher.cc',
142         'system/dispatcher.h',
143         'system/entrypoints.cc',
144         'system/handle_signals_state.h',
145         'system/handle_table.cc',
146         'system/handle_table.h',
147         'system/local_data_pipe.cc',
148         'system/local_data_pipe.h',
149         'system/local_message_pipe_endpoint.cc',
150         'system/local_message_pipe_endpoint.h',
151         'system/mapping_table.cc',
152         'system/mapping_table.h',
153         'system/memory.cc',
154         'system/memory.h',
155         'system/message_in_transit.cc',
156         'system/message_in_transit.h',
157         'system/message_in_transit_queue.cc',
158         'system/message_in_transit_queue.h',
159         'system/message_pipe.cc',
160         'system/message_pipe.h',
161         'system/message_pipe_dispatcher.cc',
162         'system/message_pipe_dispatcher.h',
163         'system/message_pipe_endpoint.cc',
164         'system/message_pipe_endpoint.h',
165         'system/options_validation.h',
166         'system/platform_handle_dispatcher.cc',
167         'system/platform_handle_dispatcher.h',
168         'system/proxy_message_pipe_endpoint.cc',
169         'system/proxy_message_pipe_endpoint.h',
170         'system/raw_channel.cc',
171         'system/raw_channel.h',
172         'system/raw_channel_posix.cc',
173         'system/raw_channel_win.cc',
174         'system/shared_buffer_dispatcher.cc',
175         'system/shared_buffer_dispatcher.h',
176         'system/simple_dispatcher.cc',
177         'system/simple_dispatcher.h',
178         'system/transport_data.cc',
179         'system/transport_data.h',
180         'system/waiter.cc',
181         'system/waiter.h',
182         'system/waiter_list.cc',
183         'system/waiter_list.h',
184         # Test-only code:
185         # TODO(vtl): It's a little unfortunate that these end up in the same
186         # component as non-test-only code. In the static build, this code should
187         # hopefully be dead-stripped.
188         'embedder/test_embedder.cc',
189         'embedder/test_embedder.h',
190       ],
191       'all_dependent_settings': {
192         # Ensures that dependent projects import the core functions on Windows.
193         'defines': ['MOJO_USE_SYSTEM_IMPL'],
194       }
195     },
196     {
197       # GN version: //mojo/system:mojo_system_unittests
198       'target_name': 'mojo_system_unittests',
199       'type': 'executable',
200       'dependencies': [
201         '../base/base.gyp:base',
202         '../testing/gtest.gyp:gtest',
203         'mojo_common_test_support',
204         'mojo_system_impl',
205       ],
206       'sources': [
207         'embedder/embedder_unittest.cc',
208         'embedder/platform_channel_pair_posix_unittest.cc',
209         'embedder/simple_platform_shared_buffer_unittest.cc',
210         'system/channel_unittest.cc',
211         'system/core_unittest.cc',
212         'system/core_test_base.cc',
213         'system/core_test_base.h',
214         'system/data_pipe_unittest.cc',
215         'system/dispatcher_unittest.cc',
216         'system/local_data_pipe_unittest.cc',
217         'system/memory_unittest.cc',
218         'system/message_pipe_dispatcher_unittest.cc',
219         'system/message_pipe_test_utils.h',
220         'system/message_pipe_test_utils.cc',
221         'system/message_pipe_unittest.cc',
222         'system/multiprocess_message_pipe_unittest.cc',
223         'system/options_validation_unittest.cc',
224         'system/platform_handle_dispatcher_unittest.cc',
225         'system/raw_channel_unittest.cc',
226         'system/remote_message_pipe_unittest.cc',
227         'system/run_all_unittests.cc',
228         'system/shared_buffer_dispatcher_unittest.cc',
229         'system/simple_dispatcher_unittest.cc',
230         'system/test_utils.cc',
231         'system/test_utils.h',
232         'system/waiter_list_unittest.cc',
233         'system/waiter_test_utils.cc',
234         'system/waiter_test_utils.h',
235         'system/waiter_unittest.cc',
236       ],
237       'conditions': [
238         ['OS=="ios"', {
239           'sources!': [
240             'embedder/embedder_unittest.cc',
241             'system/multiprocess_message_pipe_unittest.cc',
242           ],
243         }],
244       ],
245     },
246     {
247       # GN version: //mojo/system:mojo_message_pipe_perftests
248       'target_name': 'mojo_message_pipe_perftests',
249       'type': 'executable',
250       'dependencies': [
251         '../base/base.gyp:base',
252         '../base/base.gyp:test_support_base',
253         '../base/base.gyp:test_support_perf',
254         '../testing/gtest.gyp:gtest',
255         'mojo_common_test_support',
256         'mojo_environment_chromium',
257         'mojo_system_impl',
258       ],
259       'sources': [
260         'system/message_pipe_perftest.cc',
261         'system/message_pipe_test_utils.h',
262         'system/message_pipe_test_utils.cc',
263         'system/test_utils.cc',
264         'system/test_utils.h',
265       ],
266     },
267     {
268       # GN version: //mojo/common/test:test_support_impl
269       'target_name': 'mojo_test_support_impl',
270       'type': 'static_library',
271       'dependencies': [
272         '../base/base.gyp:base',
273       ],
274       'sources': [
275         'common/test/test_support_impl.cc',
276         'common/test/test_support_impl.h',
277       ],
278     },
279     {
280       # GN version: //mojo/common
281       'target_name': 'mojo_common_lib',
282       'type': '<(component)',
283       'defines': [
284         'MOJO_COMMON_IMPLEMENTATION',
285       ],
286       'dependencies': [
287         '../base/base.gyp:base',
288         '../url/url.gyp:url_lib',
289         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
290         '<(mojo_system_for_component)',
291       ],
292       'export_dependent_settings': [
293         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
294       ],
295       'sources': [
296         'common/common_type_converters.cc',
297         'common/common_type_converters.h',
298         'common/data_pipe_utils.cc',
299         'common/data_pipe_utils.h',
300         'common/handle_watcher.cc',
301         'common/handle_watcher.h',
302         'common/message_pump_mojo.cc',
303         'common/message_pump_mojo.h',
304         'common/message_pump_mojo_handler.h',
305         'common/time_helper.cc',
306         'common/time_helper.h',
307       ],
308     },
309     {
310       # GN version: //mojo/common/test:test_support
311       'target_name': 'mojo_common_test_support',
312       'type': 'static_library',
313       'dependencies': [
314         '../base/base.gyp:base',
315         '../base/base.gyp:test_support_base',
316         '../testing/gtest.gyp:gtest',
317         'mojo_system_impl',
318       ],
319       'sources': [
320         'common/test/multiprocess_test_helper.cc',
321         'common/test/multiprocess_test_helper.h',
322         'common/test/test_utils.h',
323         'common/test/test_utils_posix.cc',
324         'common/test/test_utils_win.cc',
325       ],
326       'conditions': [
327         ['OS=="ios"', {
328           'sources!': [
329             'common/test/multiprocess_test_helper.cc',
330           ],
331         }],
332       ],
333     },
334     {
335       # GN version: //mojo/common:mojo_common_unittests
336       'target_name': 'mojo_common_unittests',
337       'type': 'executable',
338       'dependencies': [
339         '../base/base.gyp:base',
340         '../base/base.gyp:base_message_loop_tests',
341         '../testing/gtest.gyp:gtest',
342         '../url/url.gyp:url_lib',
343         'mojo_cpp_bindings',
344         'mojo_environment_chromium',
345         'mojo_common_lib',
346         'mojo_common_test_support',
347         'mojo_public_test_utils',
348         'mojo_run_all_unittests',
349       ],
350       'sources': [
351         'common/common_type_converters_unittest.cc',
352         'common/handle_watcher_unittest.cc',
353         'common/message_pump_mojo_unittest.cc',
354         'common/test/multiprocess_test_helper_unittest.cc',
355       ],
356       'conditions': [
357         ['OS=="ios"', {
358           'sources!': [
359             'common/test/multiprocess_test_helper_unittest.cc',
360           ],
361         }],
362       ],
363     },
364     {
365       # GN version: //mojo/environment:chromium
366       'target_name': 'mojo_environment_chromium',
367       'type': 'static_library',
368       'dependencies': [
369         'mojo_environment_chromium_impl',
370       ],
371       'sources': [
372         'environment/environment.cc',
373         # TODO(vtl): This is kind of ugly. (See TODO in logging.h.)
374         "public/cpp/environment/logging.h",
375         "public/cpp/environment/lib/logging.cc",
376       ],
377       'include_dirs': [
378         '..',
379       ],
380       'export_dependent_settings': [
381         'mojo_environment_chromium_impl',
382       ],
383     },
384     {
385       # GN version: //mojo/environment:chromium_impl
386       'target_name': 'mojo_environment_chromium_impl',
387       'type': '<(component)',
388       'defines': [
389         'MOJO_ENVIRONMENT_IMPL_IMPLEMENTATION',
390       ],
391       'dependencies': [
392         '../base/base.gyp:base',
393         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
394         'mojo_common_lib',
395         '<(mojo_system_for_component)',
396       ],
397       'sources': [
398         'environment/default_async_waiter_impl.cc',
399         'environment/default_async_waiter_impl.h',
400         'environment/default_logger_impl.cc',
401         'environment/default_logger_impl.h',
402       ],
403       'include_dirs': [
404         '..',
405       ],
406     },
407     {
408       # GN version: //mojo/services/gles2:interfaces (for files generated from
409       # the mojom file)
410       # GN version: //mojo/services/gles2:bindings
411       'target_name': 'mojo_gles2_bindings',
412       'type': 'static_library',
413       'sources': [
414         'services/gles2/command_buffer.mojom',
415         'services/gles2/command_buffer_type_conversions.cc',
416         'services/gles2/command_buffer_type_conversions.h',
417         'services/gles2/mojo_buffer_backing.cc',
418         'services/gles2/mojo_buffer_backing.h',
419       ],
420       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
421       'export_dependent_settings': [
422         'mojo_cpp_bindings',
423       ],
424       'dependencies': [
425         'mojo_cpp_bindings',
426         '../gpu/gpu.gyp:command_buffer_common',
427       ],
428     },
429     {
430       # GN version: //mojo/gles2
431       'target_name': 'mojo_gles2_impl',
432       'type': '<(component)',
433       'dependencies': [
434         '../base/base.gyp:base',
435         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
436         '../gpu/gpu.gyp:command_buffer_client',
437         '../gpu/gpu.gyp:command_buffer_common',
438         '../gpu/gpu.gyp:gles2_cmd_helper',
439         '../gpu/gpu.gyp:gles2_implementation',
440         'mojo_environment_chromium',
441         'mojo_gles2_bindings',
442         '<(mojo_system_for_component)',
443       ],
444       'defines': [
445         'GLES2_USE_MOJO',
446         'GL_GLEXT_PROTOTYPES',
447         'MOJO_GLES2_IMPLEMENTATION',
448         'MOJO_GLES2_IMPL_IMPLEMENTATION',
449         'MOJO_USE_GLES2_IMPL'
450       ],
451       'direct_dependent_settings': {
452         'defines': [
453           'GLES2_USE_MOJO',
454         ],
455       },
456       'export_dependent_settings': [
457         'mojo_gles2_bindings',
458       ],
459       'sources': [
460         'gles2/command_buffer_client_impl.cc',
461         'gles2/command_buffer_client_impl.h',
462         'gles2/gles2_impl_export.h',
463         'gles2/gles2_impl.cc',
464         'gles2/gles2_context.cc',
465         'gles2/gles2_context.h',
466       ],
467       'all_dependent_settings': {
468         # Ensures that dependent projects import the core functions on Windows.
469         'defines': ['MOJO_USE_GLES2_IMPL'],
470       }
471     },
472     {
473      # GN version: //mojo/application
474      'target_name': 'mojo_application_chromium',
475      'type': 'static_library',
476      'sources': [
477        'application/application_runner_chromium.cc',
478        'application/application_runner_chromium.h',
479       ],
480       'dependencies': [
481         'mojo_application_base',
482         'mojo_common_lib',
483         'mojo_environment_chromium',
484        ],
485       'export_dependent_settings': [
486         'mojo_application_base',
487        ],
488     },
489     {
490       # GN version: //mojo/bindings/js
491       'target_name': 'mojo_js_bindings_lib',
492       'type': 'static_library',
493       'dependencies': [
494         '../base/base.gyp:base',
495         '../gin/gin.gyp:gin',
496         '../v8/tools/gyp/v8.gyp:v8',
497         'mojo_common_lib',
498       ],
499       'export_dependent_settings': [
500         '../base/base.gyp:base',
501         '../gin/gin.gyp:gin',
502         'mojo_common_lib',
503       ],
504       'sources': [
505         # Sources list duplicated in GN build.
506         'bindings/js/core.cc',
507         'bindings/js/core.h',
508         'bindings/js/drain_data.cc',
509         'bindings/js/drain_data.h',
510         'bindings/js/handle.cc',
511         'bindings/js/handle.h',
512         'bindings/js/handle_close_observer.h',
513         'bindings/js/support.cc',
514         'bindings/js/support.h',
515         'bindings/js/waiting_callback.cc',
516         'bindings/js/waiting_callback.h',
517       ],
518     },
519     {
520       # GN version: //mojo/tools:message_generator
521       'target_name': 'mojo_message_generator',
522       'type': 'executable',
523       'dependencies': [
524         '../base/base.gyp:base',
525         '../testing/gtest.gyp:gtest',
526         'mojo_common_lib',
527         'mojo_cpp_bindings',
528         'mojo_environment_chromium',
529         'mojo_system_impl',
530       ],
531       'sources': [
532         'tools/message_generator.cc',
533       ],
534     },
535   ],
536   'conditions': [
537     ['OS=="android"', {
538       'targets': [
539         {
540           'target_name': 'mojo_jni_headers',
541           'type': 'none',
542           'dependencies': [
543             'mojo_java_set_jni_headers',
544           ],
545           'sources': [
546             'android/javatests/src/org/chromium/mojo/MojoTestCase.java',
547             'android/javatests/src/org/chromium/mojo/bindings/ValidationTestUtil.java',
548             'android/system/src/org/chromium/mojo/system/impl/CoreImpl.java',
549             'services/native_viewport/android/src/org/chromium/mojo/PlatformViewportAndroid.java',
550             'shell/android/apk/src/org/chromium/mojo_shell_apk/MojoMain.java',
551           ],
552           'variables': {
553             'jni_gen_package': 'mojo',
554          },
555           'includes': [ '../build/jni_generator.gypi' ],
556         },
557         {
558           'target_name': 'mojo_java_set_jni_headers',
559           'type': 'none',
560           'variables': {
561             'jni_gen_package': 'mojo',
562             'input_java_class': 'java/util/HashSet.class',
563           },
564           'includes': [ '../build/jar_file_jni_generator.gypi' ],
565         },
566         {
567           'target_name': 'mojo_system_java',
568           'type': 'none',
569           'dependencies': [
570             '../base/base.gyp:base_java',
571             'mojo_public_java',
572           ],
573           'variables': {
574             'java_in_dir': '<(DEPTH)/mojo/android/system',
575           },
576           'includes': [ '../build/java.gypi' ],
577         },
578         {
579           'target_name': 'libmojo_system_java',
580           'type': 'static_library',
581           'dependencies': [
582             '../base/base.gyp:base',
583             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
584             'mojo_common_lib',
585             'mojo_environment_chromium',
586             'mojo_jni_headers',
587             'mojo_system_impl',
588           ],
589           'sources': [
590             'android/system/core_impl.cc',
591             'android/system/core_impl.h',
592           ],
593         },
594         {
595           'target_name': 'libmojo_java_unittest',
596           'type': 'shared_library',
597           'dependencies': [
598             '../base/base.gyp:base',
599             '../base/base.gyp:test_support_base',
600             'libmojo_system_java',
601             'mojo_jni_headers',
602             'mojo_public_bindings_test_utils',
603           ],
604           'defines': [
605             'UNIT_TEST'  # As exported from testing/gtest.gyp:gtest.
606           ],
607           'sources': [
608             'android/javatests/mojo_test_case.cc',
609             'android/javatests/mojo_test_case.h',
610             'android/javatests/init_library.cc',
611             'android/javatests/validation_test_util.cc',
612             'android/javatests/validation_test_util.h',
613           ],
614         },
615         {
616           'target_name': 'mojo_test_apk',
617           'type': 'none',
618           'dependencies': [
619             'mojo_bindings_java',
620             'mojo_public_test_interfaces',
621             'mojo_system_java',
622             '../base/base.gyp:base_java_test_support',
623           ],
624           'variables': {
625             'apk_name': 'MojoTest',
626             'java_in_dir': '<(DEPTH)/mojo/android/javatests',
627             'resource_dir': '<(DEPTH)/mojo/android/javatests/apk',
628             'native_lib_target': 'libmojo_java_unittest',
629             'is_test_apk': 1,
630             # Given that this apk tests itself, it needs to bring emma with it
631             # when instrumented.
632             'conditions': [
633               ['emma_coverage != 0', {
634                 'emma_instrument': 1,
635               }],
636             ],
637           },
638           'includes': [ '../build/java_apk.gypi' ],
639         },
640       ]
641     }],
642     ['test_isolation_mode != "noop"', {
643       'targets': [
644         {
645           'target_name': 'mojo_js_unittests_run',
646           'type': 'none',
647           'dependencies': [
648             'mojo_js_unittests',
649           ],
650           'includes': [
651             '../build/isolate.gypi',
652             'mojo_js_unittests.isolate',
653           ],
654           'sources': [
655             'mojo_js_unittests.isolate',
656           ],
657         },
658       ],
659     }],
660   ]