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