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