Update .DEPS.git
[chromium-blink-merge.git] / mojo / mojo.gyp
blob1e0155ca8df74c84f6eaa540d241d566594b9546
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'target_defaults': {
7     'conditions': [
8       ['mojo_shell_debug_url != ""', {
9         'defines': [
10           'MOJO_SHELL_DEBUG=1',
11           'MOJO_SHELL_DEBUG_URL="<(mojo_shell_debug_url)"',
12          ],
13       }],
14     ],
15   },
16   'variables': {
17     'chromium_code': 1,
18     'mojo_shell_debug_url%': "",
19   },
20   'includes': [
21     'mojo_apps.gypi',
22     'mojo_examples.gypi',
23     'mojo_public.gypi',
24     'mojo_services.gypi',
25   ],
26   'targets': [
27     {
28       'target_name': 'mojo',
29       'type': 'none',
30       'dependencies': [
31         'mojo_bindings',
32         'mojo_compositor_app',
33         'mojo_common_lib',
34         'mojo_common_unittests',
35         'mojo_js',
36         'mojo_js_unittests',
37         'mojo_public_test_support',
38         'mojo_public_bindings_unittests',
39         'mojo_public_environment_unittests',
40         'mojo_public_system_perftests',
41         'mojo_public_system_unittests',
42         'mojo_public_utility_unittests',
43         'mojo_sample_app',
44         'mojo_shell',
45         'mojo_shell_lib',
46         'mojo_shell_unittests',
47         'mojo_system',
48         'mojo_system_impl',
49         'mojo_system_unittests',
50         'mojo_utility',
51       ],
52       'conditions': [
53         ['use_aura==1', {
54           'dependencies': [
55             'mojo_aura_demo',
56           ],
57         }],
58       ]
59     },
60     {
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',
68         'mojo_system_impl',
69       ],
70       'sources': [
71         'common/test/run_all_unittests.cc',
72       ],
73     },
74     {
75       'target_name': 'mojo_run_all_perftests',
76       'type': 'static_library',
77       'dependencies': [
78         '../base/base.gyp:test_support_base',
79         'mojo_system',
80         'mojo_system_impl',
81       ],
82       'sources': [
83         'common/test/run_all_perftests.cc',
84       ],
85     },
86     {
87       'target_name': 'mojo_system_impl',
88       'type': '<(component)',
89       'dependencies': [
90         'mojo_system',
91         '../base/base.gyp:base',
92       ],
93       'defines': [
94         'MOJO_SYSTEM_IMPL_IMPLEMENTATION',
95       ],
96       'sources': [
97         'system/channel.cc',
98         'system/channel.h',
99         'system/constants.h',
100         'system/core_impl.cc',
101         'system/core_impl.h',
102         'system/data_pipe.cc',
103         'system/data_pipe.h',
104         'system/data_pipe_consumer_dispatcher.cc',
105         'system/data_pipe_consumer_dispatcher.h',
106         'system/data_pipe_producer_dispatcher.cc',
107         'system/data_pipe_producer_dispatcher.h',
108         'system/dispatcher.cc',
109         'system/dispatcher.h',
110         'system/embedder/embedder.cc',
111         'system/embedder/embedder.h',
112         'system/embedder/platform_channel_pair.cc',
113         'system/embedder/platform_channel_pair.h',
114         'system/embedder/platform_channel_pair_posix.cc',
115         'system/embedder/platform_handle.cc',
116         'system/embedder/platform_handle.h',
117         'system/embedder/scoped_platform_handle.h',
118         'system/local_data_pipe.cc',
119         'system/local_data_pipe.h',
120         'system/local_message_pipe_endpoint.cc',
121         'system/local_message_pipe_endpoint.h',
122         'system/memory.cc',
123         'system/memory.h',
124         'system/message_in_transit.cc',
125         'system/message_in_transit.h',
126         'system/message_pipe.cc',
127         'system/message_pipe.h',
128         'system/message_pipe_dispatcher.cc',
129         'system/message_pipe_dispatcher.h',
130         'system/message_pipe_endpoint.cc',
131         'system/message_pipe_endpoint.h',
132         'system/proxy_message_pipe_endpoint.cc',
133         'system/proxy_message_pipe_endpoint.h',
134         'system/raw_channel.h',
135         'system/raw_channel_posix.cc',
136         'system/raw_channel_win.cc',
137         'system/simple_dispatcher.cc',
138         'system/simple_dispatcher.h',
139         'system/waiter.cc',
140         'system/waiter.h',
141         'system/waiter_list.cc',
142         'system/waiter_list.h',
143         # Test-only code:
144         # TODO(vtl): It's a little unfortunate that these end up in the same
145         # component as non-test-only code. In the static build, this code should
146         # hopefully be dead-stripped.
147         'system/embedder/test_embedder.cc',
148         'system/embedder/test_embedder.h',
149       ],
150     },
151     {
152       'target_name': 'mojo_system_unittests',
153       'type': 'executable',
154       'dependencies': [
155         '../base/base.gyp:run_all_unittests',
156         '../testing/gtest.gyp:gtest',
157         'mojo_common_test_support',
158         'mojo_system',
159         'mojo_system_impl',
160       ],
161       'sources': [
162         'system/core_impl_unittest.cc',
163         'system/core_test_base.cc',
164         'system/core_test_base.h',
165         'system/data_pipe_unittest.cc',
166         'system/dispatcher_unittest.cc',
167         'system/embedder/embedder_unittest.cc',
168         'system/local_data_pipe_unittest.cc',
169         'system/message_pipe_dispatcher_unittest.cc',
170         'system/message_pipe_unittest.cc',
171         'system/multiprocess_message_pipe_unittest.cc',
172         'system/raw_channel_posix_unittest.cc',
173         'system/remote_message_pipe_posix_unittest.cc',
174         'system/simple_dispatcher_unittest.cc',
175         'system/test_utils.cc',
176         'system/test_utils.h',
177         'system/waiter_list_unittest.cc',
178         'system/waiter_test_utils.cc',
179         'system/waiter_test_utils.h',
180         'system/waiter_unittest.cc',
181       ],
182     },
183     {
184       'target_name': 'mojo_gles2_impl',
185       'type': '<(component)',
186       'dependencies': [
187         '../base/base.gyp:base',
188         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
189         'mojo_gles2',
190         'mojo_gles2_bindings',
191         'mojo_environment_chromium',
192       ],
193       'defines': [
194         'MOJO_GLES2_IMPL_IMPLEMENTATION',
195       ],
196       'sources': [
197         'gles2/gles2_impl_export.h',
198         'gles2/gles2_support_impl.cc',
199         'gles2/gles2_support_impl.h',
200         'gles2/gles2_client_impl.cc',
201         'gles2/gles2_client_impl.h',
202       ],
203     },
204     {
205       'target_name': 'mojo_common_lib',
206       'type': '<(component)',
207       'defines': [
208         'MOJO_COMMON_IMPLEMENTATION',
209       ],
210       'dependencies': [
211         '../base/base.gyp:base',
212         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
213         'mojo_system',
214       ],
215       'sources': [
216         'common/common_type_converters.cc',
217         'common/common_type_converters.h',
218         'common/handle_watcher.cc',
219         'common/handle_watcher.h',
220         'common/message_pump_mojo.cc',
221         'common/message_pump_mojo.h',
222         'common/message_pump_mojo_handler.h',
223       ],
224       'conditions': [
225         ['OS == "win"', {
226           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
227           'msvs_disabled_warnings': [
228             4267,
229           ],
230         }],
231       ],
232     },
233     {
234       'target_name': 'mojo_common_test_support',
235       'type': 'static_library',
236       'dependencies': [
237         '../base/base.gyp:base',
238         '../base/base.gyp:test_support_base',
239         '../testing/gtest.gyp:gtest',
240         'mojo_system',
241         'mojo_system_impl',
242       ],
243       'sources': [
244         'common/test/multiprocess_test_base.cc',
245         'common/test/multiprocess_test_base.h',
246       ],
247     },
248     {
249       'target_name': 'mojo_common_unittests',
250       'type': 'executable',
251       'dependencies': [
252         '../base/base.gyp:base',
253         '../base/base.gyp:base_message_loop_tests',
254         '../testing/gtest.gyp:gtest',
255         'mojo_bindings',
256         'mojo_environment_chromium',
257         'mojo_common_lib',
258         'mojo_common_test_support',
259         'mojo_public_test_support',
260         'mojo_run_all_unittests',
261         'mojo_system',
262         'mojo_system_impl',
263       ],
264       'sources': [
265         'common/common_type_converters_unittest.cc',
266         'common/handle_watcher_unittest.cc',
267         'common/message_pump_mojo_unittest.cc',
268         'common/test/multiprocess_test_base_unittest.cc',
269       ],
270       'conditions': [
271         ['OS == "win"', {
272           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
273           'msvs_disabled_warnings': [
274             4267,
275           ],
276         }],
277       ],
278     },
279     {
280       'target_name': 'mojo_environment_chromium',
281       'type': 'static_library',
282       'dependencies': [
283         'mojo_environment_chromium_impl',
284       ],
285       'sources': [
286         'environment/default_async_waiter.cc',
287         'environment/buffer_tls.cc',
288         'environment/environment.cc',
289       ],
290       'include_dirs': [
291         '..',
292       ],
293       'export_dependent_settings': [
294         'mojo_environment_chromium_impl',
295       ],
296     },
297     {
298       'target_name': 'mojo_environment_chromium_impl',
299       'type': '<(component)',
300       'defines': [
301         'MOJO_ENVIRONMENT_IMPL_IMPLEMENTATION',
302       ],
303       'dependencies': [
304         '../base/base.gyp:base',
305         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
306         'mojo_common_lib'
307       ],
308       'sources': [
309         'environment/default_async_waiter_impl.cc',
310         'environment/default_async_waiter_impl.h',
311         'environment/buffer_tls_impl.cc',
312         'environment/buffer_tls_impl.h',
313       ],
314       'include_dirs': [
315         '..',
316       ],
317     },
318     {
319       'target_name': 'mojo_shell_lib',
320       'type': 'static_library',
321       'dependencies': [
322         '../base/base.gyp:base',
323         '../net/net.gyp:net',
324         '../url/url.gyp:url_lib',
325         'mojo_gles2_impl',
326         'mojo_shell_bindings',
327         'mojo_system',
328         'mojo_system_impl',
329         'mojo_native_viewport_service',
330       ],
331       'sources': [
332         'shell/context.cc',
333         'shell/context.h',
334         'shell/dynamic_service_loader.cc',
335         'shell/dynamic_service_loader.h',
336         'shell/init.cc',
337         'shell/init.h',
338         'shell/loader.cc',
339         'shell/loader.h',
340         'shell/network_delegate.cc',
341         'shell/network_delegate.h',
342         'shell/run.cc',
343         'shell/run.h',
344         'shell/service_manager.cc',
345         'shell/service_manager.h',
346         'shell/storage.cc',
347         'shell/storage.h',
348         'shell/switches.cc',
349         'shell/switches.h',
350         'shell/task_runners.cc',
351         'shell/task_runners.h',
352         'shell/url_request_context_getter.cc',
353         'shell/url_request_context_getter.h',
354       ],
355       'conditions': [
356         ['OS == "win"', {
357           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
358           'msvs_disabled_warnings': [
359             4267,
360           ],
361         }],
362       ],
363     },
364     {
365       'target_name': 'mojo_shell_bindings',
366       'type': 'static_library',
367       'sources': [
368         'shell/shell.mojom',
369       ],
370       'includes': [ 'public/bindings/mojom_bindings_generator.gypi' ],
371       'export_dependent_settings': [
372         'mojo_bindings',
373         'mojo_system',
374       ],
375     },
376     {
377       'target_name': 'mojo_shell',
378       'type': 'executable',
379       'dependencies': [
380         '../base/base.gyp:base',
381         '../ui/gl/gl.gyp:gl',
382         '../url/url.gyp:url_lib',
383         'mojo_common_lib',
384         'mojo_environment_chromium',
385         'mojo_shell_lib',
386         'mojo_system',
387         'mojo_system_impl',
388       ],
389       'sources': [
390         'shell/desktop/mojo_main.cc',
391       ],
392       'conditions': [
393         ['OS == "win"', {
394           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
395           'msvs_disabled_warnings': [
396             4267,
397           ],
398         }],
399       ],
400     },
401     {
402       'target_name': 'mojo_shell_unittests',
403       'type': 'executable',
404       'dependencies': [
405         '../base/base.gyp:base',
406         '../testing/gtest.gyp:gtest',
407         'mojo_common_lib',
408         'mojo_environment_chromium',
409         'mojo_run_all_unittests',
410         'mojo_shell_lib',
411       ],
412       'includes': [ 'public/bindings/mojom_bindings_generator.gypi' ],
413       'sources': [
414         'shell/service_manager_unittest.cc',
415         'shell/test.mojom',
416       ],
417     },
418   ],
419   'conditions': [
420     ['OS=="android"', {
421       'targets': [
422         {
423           'target_name': 'mojo_native_viewport_java',
424           'type': 'none',
425           'dependencies': [
426             '../base/base.gyp:base_java',
427           ],
428           'variables': {
429             'java_in_dir': '<(DEPTH)/mojo/services/native_viewport/android',
430           },
431           'includes': [ '../build/java.gypi' ],
432         },
433         {
434           'target_name': 'mojo_java_set_jni_headers',
435           'type': 'none',
436           'variables': {
437             'jni_gen_package': 'mojo',
438             'jni_generator_ptr_type': 'long',
439             'input_java_class': 'java/util/HashSet.class',
440           },
441           'includes': [ '../build/jar_file_jni_generator.gypi' ],
442         },
443         {
444           'target_name': 'mojo_jni_headers',
445           'type': 'none',
446           'dependencies': [
447             'mojo_java_set_jni_headers',
448           ],
449           'sources': [
450             'services/native_viewport/android/src/org/chromium/mojo/NativeViewportAndroid.java',
451             'shell/android/apk/src/org/chromium/mojo_shell_apk/MojoMain.java',
452           ],
453           'variables': {
454             'jni_gen_package': 'mojo',
455             'jni_generator_ptr_type': 'long',
456          },
457           'includes': [ '../build/jni_generator.gypi' ],
458         },
459         {
460           'target_name': 'libmojo_shell',
461           'type': 'shared_library',
462           'dependencies': [
463             '../base/base.gyp:base',
464             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
465             '../ui/gfx/gfx.gyp:gfx',
466             '../ui/gfx/gfx.gyp:gfx_geometry',
467             '../ui/gl/gl.gyp:gl',
468             'mojo_common_lib',
469             'mojo_environment_chromium',
470             'mojo_jni_headers',
471             'mojo_shell_bindings',
472             'mojo_shell_lib',
473           ],
474           'sources': [
475             'shell/android/library_loader.cc',
476             'shell/android/mojo_main.cc',
477             'shell/android/mojo_main.h',
478           ],
479         },
480         {
481           'target_name': 'mojo_shell_apk',
482           'type': 'none',
483           'dependencies': [
484             '../base/base.gyp:base_java',
485             '../net/net.gyp:net_java',
486             'mojo_native_viewport_java',
487             'libmojo_shell',
488           ],
489           'variables': {
490             'apk_name': 'MojoShell',
491             'java_in_dir': '<(DEPTH)/mojo/shell/android/apk',
492             'resource_dir': '<(DEPTH)/mojo/shell/android/apk/res',
493             'native_lib_target': 'libmojo_shell',
494           },
495           'includes': [ '../build/java_apk.gypi' ],
496         }
497       ],
498     }],
499   ],