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