Move RegistryDict to components/policy/.
[chromium-blink-merge.git] / mojo / mojo.gyp
blob83171679c2132e0e7a27aa837f192d10e2e38521
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   'variables': {
7     'chromium_code': 1,
8   },
9   'targets': [
10     {
11       'target_name': 'mojo',
12       'type': 'none',
13       'dependencies': [
14         'mojo_common_lib',
15         'mojo_common_unittests',
16         'mojo_public_test_support',
17         'mojo_public_unittests',
18         'mojo_public_perftests',
19         'mojo_system',
20         'mojo_system_unittests',
21         'mojo_shell_lib',
22         'mojo_shell',
23         'mojo_js',
24         'sample_app',
25         'mojo_bindings',
26         'mojom_test',
27         'mojo_bindings_test',
28         'mojo_js_bindings',
29         'mojo_js_bindings_unittests',
30         'mojo_bindings',
31       ],
32     },
33     {
34       'target_name': 'mojo_public_test_support',
35       'type': 'static_library',
36       'dependencies': [
37         '../base/base.gyp:base',
38         '../testing/gtest.gyp:gtest',
39         'mojo_system',
40       ],
41       'sources': [
42         'public/tests/simple_bindings_support.cc',
43         'public/tests/simple_bindings_support.h',
44         'public/tests/test_support.cc',
45         'public/tests/test_support.h',
46       ],
47     },
48     {
49       'target_name': 'mojo_run_all_unittests',
50       'type': 'static_library',
51       'dependencies': [
52         '../base/base.gyp:base',
53         '../base/base.gyp:test_support_base',
54         'mojo_system',
55       ],
56       'sources': [
57         'common/test/run_all_unittests.cc',
58       ],
59     },
60     {
61       'target_name': 'mojo_common_lib',
62       'type': '<(component)',
63       'defines': [
64         'MOJO_COMMON_IMPLEMENTATION',
65       ],
66       'dependencies': [
67         '../base/base.gyp:base',
68         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
69         'mojo_system',
70       ],
71       'sources': [
72         'common/bindings_support_impl.cc',
73         'common/bindings_support_impl.h',
74         'common/handle_watcher.cc',
75         'common/handle_watcher.h',
76         'common/message_pump_mojo.cc',
77         'common/message_pump_mojo.h',
78         'common/message_pump_mojo_handler.h',
79       ],
80       'conditions': [
81         ['OS == "win"', {
82           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
83           'msvs_disabled_warnings': [
84             4267,
85           ],
86         }],
87       ],
88     },
89     {
90       'target_name': 'mojo_common_unittests',
91       'type': 'executable',
92       'dependencies': [
93         '../base/base.gyp:base',
94         '../base/base.gyp:base_message_loop_tests',
95         '../testing/gtest.gyp:gtest',
96         'mojo_common_lib',
97         'mojo_run_all_unittests',
98         'mojo_system',
99       ],
100       'sources': [
101         'common/handle_watcher_unittest.cc',
102         'common/message_pump_mojo_unittest.cc',
103       ],
104       'conditions': [
105         ['OS == "win"', {
106           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
107           'msvs_disabled_warnings': [
108             4267,
109           ],
110         }],
111       ],
112     },
113     {
114       'target_name': 'mojo_public_unittests',
115       'type': 'executable',
116       'dependencies': [
117         '../testing/gtest.gyp:gtest',
118         'mojo_bindings',
119         'mojo_public_test_support',
120         'mojo_run_all_unittests',
121         'mojo_system',
122       ],
123       'sources': [
124         'public/tests/bindings_connector_unittest.cc',
125         'public/tests/bindings_remote_ptr_unittest.cc',
126         'public/tests/buffer_unittest.cc',
127         'public/tests/math_calculator.mojom',
128         'public/tests/system_core_cpp_unittest.cc',
129         'public/tests/system_core_unittest.cc',
130       ],
131       'includes': [ 'public/bindings/mojom_bindings_generator.gypi' ],
132     },
133     {
134       'target_name': 'mojo_public_perftests',
135       'type': 'executable',
136       'dependencies': [
137         '../base/base.gyp:base',
138         '../base/base.gyp:test_support_perf',
139         '../testing/gtest.gyp:gtest',
140         'mojo_public_test_support',
141         'mojo_run_all_unittests',
142         'mojo_system',
143       ],
144       'sources': [
145         'public/tests/system_core_perftest.cc',
146       ],
147     },
148     {
149       'target_name': 'mojo_system',
150       'type': '<(component)',
151       'dependencies': [
152         '../base/base.gyp:base',
153       ],
154       'defines': [
155         'MOJO_SYSTEM_IMPLEMENTATION',
156       ],
157       'sources': [
158         'system/channel.cc',
159         'system/channel.h',
160         'system/core.cc',
161         'system/core_impl.cc',
162         'system/core_impl.h',
163         'system/dispatcher.cc',
164         'system/dispatcher.h',
165         'system/limits.h',
166         'system/local_message_pipe_endpoint.cc',
167         'system/local_message_pipe_endpoint.h',
168         'system/memory.cc',
169         'system/memory.h',
170         'system/message_in_transit.cc',
171         'system/message_in_transit.h',
172         'system/message_pipe.cc',
173         'system/message_pipe.h',
174         'system/message_pipe_dispatcher.cc',
175         'system/message_pipe_dispatcher.h',
176         'system/message_pipe_endpoint.cc',
177         'system/message_pipe_endpoint.h',
178         'system/platform_channel_handle.h',
179         'system/proxy_message_pipe_endpoint.cc',
180         'system/proxy_message_pipe_endpoint.h',
181         'system/raw_channel.h',
182         'system/raw_channel_posix.cc',
183         'system/raw_channel_win.cc',
184         'system/simple_dispatcher.cc',
185         'system/simple_dispatcher.h',
186         'system/waiter.cc',
187         'system/waiter.h',
188         'system/waiter_list.cc',
189         'system/waiter_list.h',
190       ],
191       'direct_dependent_settings': {
192         'include_dirs': [
193           '..',
194         ],
195       },
196     },
197     {
198       'target_name': 'mojo_system_unittests',
199       'type': 'executable',
200       'dependencies': [
201         '../base/base.gyp:run_all_unittests',
202         '../testing/gtest.gyp:gtest',
203         'mojo_system',
204       ],
205       'sources': [
206         'system/core_impl_unittest.cc',
207         'system/core_test_base.cc',
208         'system/core_test_base.h',
209         'system/dispatcher_unittest.cc',
210         'system/message_pipe_dispatcher_unittest.cc',
211         'system/message_pipe_unittest.cc',
212         'system/raw_channel_posix_unittest.cc',
213         'system/remote_message_pipe_posix_unittest.cc',
214         'system/simple_dispatcher_unittest.cc',
215         'system/test_utils.cc',
216         'system/test_utils.h',
217         'system/waiter_list_unittest.cc',
218         'system/waiter_test_utils.cc',
219         'system/waiter_test_utils.h',
220         'system/waiter_unittest.cc',
221       ],
222     },
223     {
224       'target_name': 'mojo_shell_lib',
225       'type': 'static_library',
226       'dependencies': [
227         '../base/base.gyp:base',
228         '../net/net.gyp:net',
229         '../url/url.gyp:url_lib',
230         'mojo_bindings',
231         'mojo_system',
232         'native_viewport',
233         'hello_world_service_impl',
234       ],
235       'sources': [
236         'shell/app_container.cc',
237         'shell/app_container.h',
238         'shell/context.cc',
239         'shell/context.h',
240         'shell/init.cc',
241         'shell/init.h',
242         'shell/loader.cc',
243         'shell/loader.h',
244         'shell/network_delegate.cc',
245         'shell/network_delegate.h',
246         'shell/run.cc',
247         'shell/run.h',
248         'shell/storage.cc',
249         'shell/storage.h',
250         'shell/switches.cc',
251         'shell/switches.h',
252         'shell/task_runners.cc',
253         'shell/task_runners.h',
254         'shell/url_request_context_getter.cc',
255         'shell/url_request_context_getter.h',
256       ],
257       'conditions': [
258         ['OS == "win"', {
259           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
260           'msvs_disabled_warnings': [
261             4267,
262           ],
263         }],
264       ],
265     },
266     {
267       'target_name': 'mojo_shell',
268       'type': 'executable',
269       'dependencies': [
270         '../base/base.gyp:base',
271         '../ui/gl/gl.gyp:gl',
272         '../url/url.gyp:url_lib',
273         'mojo_common_lib',
274         'mojo_shell_lib',
275         'mojo_system',
276       ],
277       'sources': [
278         'shell/desktop/mojo_main.cc',
279       ],
280       'conditions': [
281         ['OS == "win"', {
282           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
283           'msvs_disabled_warnings': [
284             4267,
285           ],
286         }],
287       ],
288     },
289     {
290       'target_name': 'mojo_js',
291       'type': 'shared_library',
292       'dependencies': [
293         '../base/base.gyp:base',
294         '../gin/gin.gyp:gin',
295         'hello_world_service',
296         'mojo_common_lib',
297         'mojo_js_bindings',
298         'mojo_system',
299       ],
300       'sources': [
301         'apps/js/bootstrap.cc',
302         'apps/js/bootstrap.h',
303         'apps/js/main.cc',
304         'apps/js/mojo_runner_delegate.cc',
305         'apps/js/mojo_runner_delegate.h',
306       ],
307     },
308     {
309       'target_name': 'sample_app',
310       'type': 'shared_library',
311       'dependencies': [
312         '../base/base.gyp:base',
313         '../ui/gl/gl.gyp:gl',
314         'hello_world_service',
315         'mojo_common_lib',
316         'mojo_system',
317       ],
318       'sources': [
319         'examples/sample_app/hello_world_client_impl.cc',
320         'examples/sample_app/hello_world_client_impl.h',
321         'examples/sample_app/sample_app.cc',
322         'examples/sample_app/spinning_cube.cc',
323         'examples/sample_app/spinning_cube.h',
324       ],
325     },
326     {
327       'target_name': 'hello_world_service',
328       'type': 'static_library',
329       'dependencies': [
330         'mojo_bindings',
331         'mojo_system',
332       ],
333       'export_dependent_settings': [
334         'mojo_bindings',
335         'mojo_system',
336       ],
337       'sources': [
338         'examples/hello_world_service/hello_world_service.mojom',
339       ],
340       'includes': [ 'public/bindings/mojom_bindings_generator.gypi' ],
341     },
342     {
343       'target_name': 'hello_world_service_impl',
344       'type': 'static_library',
345       'sources': [
346         'examples/hello_world_service/hello_world_service_impl.cc',
347         'examples/hello_world_service/hello_world_service_impl.h',
348       ],
349       'export_dependent_settings': [
350         'hello_world_service',
351       ],
352       'dependencies': [
353         '../base/base.gyp:base',
354         'hello_world_service',
355       ],
356     },
357     {
358       'target_name': 'mojo_bindings',
359       'type': 'static_library',
360       'include_dirs': [
361         '..'
362       ],
363       'sources': [
364         'public/bindings/lib/bindings.h',
365         'public/bindings/lib/bindings_internal.h',
366         'public/bindings/lib/bindings_serialization.cc',
367         'public/bindings/lib/bindings_serialization.h',
368         'public/bindings/lib/bindings_support.cc',
369         'public/bindings/lib/bindings_support.h',
370         'public/bindings/lib/buffer.cc',
371         'public/bindings/lib/buffer.h',
372         'public/bindings/lib/connector.cc',
373         'public/bindings/lib/connector.h',
374         'public/bindings/lib/message.cc',
375         'public/bindings/lib/message.h',
376         'public/bindings/lib/message_builder.cc',
377         'public/bindings/lib/message_builder.h',
378         'public/bindings/lib/message_queue.cc',
379         'public/bindings/lib/message_queue.h',
380       ],
381     },
382     {
383       'target_name': 'mojom_test',
384       'type': 'executable',
385       'sources': [
386         'public/bindings/sample/sample_test.cc',
387         'public/bindings/sample/sample_service.mojom',
388       ],
389       'includes': [ 'public/bindings/mojom_bindings_generator.gypi' ],
390       'dependencies': [
391         '../testing/gtest.gyp:gtest',
392         'mojo_bindings',
393         'mojo_run_all_unittests',
394         'mojo_system',
395       ],
396     },
397     {
398       'target_name': 'mojo_bindings_test',
399       'type': 'executable',
400       'include_dirs': [
401         '..',
402         '<(DEPTH)/mojo/public/bindings/sample',
403       ],
404       'dependencies': [
405         '../testing/gtest.gyp:gtest',
406         'mojo_bindings',
407         'mojo_run_all_unittests',
408         'mojo_system',
409       ],
410       'sources': [
411         'public/bindings/sample/mojom/sample_service.cc',
412         'public/bindings/sample/mojom/sample_service.h',
413         'public/bindings/sample/mojom/sample_service_internal.h',
414         'public/bindings/sample/sample_test.cc',
415       ],
416     },
417      {
418       'target_name': 'mojo_js_bindings',
419       'type': 'static_library',
420       'include_dirs': [
421         '..'
422       ],
423       'dependencies': [
424         '../gin/gin.gyp:gin',
425         'mojo_system',
426       ],
427       'export_dependent_settings': [
428         '../gin/gin.gyp:gin',
429       ],
430       'sources': [
431         'public/bindings/js/core.cc',
432         'public/bindings/js/core.h',
433         'public/bindings/js/handle.cc',
434         'public/bindings/js/handle.h',
435         'public/bindings/js/support.cc',
436         'public/bindings/js/support.h',
437         'public/bindings/js/waiting_callback.cc',
438         'public/bindings/js/waiting_callback.h',
439       ],
440     },
441     {
442       'target_name': 'mojo_js_bindings_unittests',
443       'type': 'executable',
444       'dependencies': [
445         '../base/base.gyp:run_all_unittests',
446         '../gin/gin.gyp:gin_test',
447         'mojom_test',
448         'mojo_js_bindings',
449       ],
450       'sources': [
451         'public/bindings/js/test/run_all_unittests.cc',
452         'public/bindings/js/test/run_js_tests.cc',
453       ],
454     },
455     {
456       'target_name': 'native_viewport',
457       'type': 'static_library',
458       'dependencies': [
459         '../base/base.gyp:base',
460         '../gpu/gpu.gyp:command_buffer_service',
461         '../gpu/gpu.gyp:gles2_implementation',
462         '../ui/events/events.gyp:events',
463         '../ui/gfx/gfx.gyp:gfx',
464         '../ui/gl/gl.gyp:gl',
465       ],
466       'sources': [
467         'services/native_viewport/android/mojo_viewport.cc',
468         'services/native_viewport/android/mojo_viewport.h',
469         'services/native_viewport/native_viewport.h',
470         'services/native_viewport/native_viewport_android.cc',
471         'services/native_viewport/native_viewport_controller.cc',
472         'services/native_viewport/native_viewport_controller.h',
473         'services/native_viewport/native_viewport_mac.mm',
474         'services/native_viewport/native_viewport_stub.cc',
475         'services/native_viewport/native_viewport_win.cc',
476         'services/native_viewport/native_viewport_x11.cc',
477       ],
478       'conditions': [
479         ['OS=="win" or OS=="android" or OS=="linux" or OS=="mac"', {
480           'sources!': [
481             'services/native_viewport/native_viewport_stub.cc',
482           ],
483         }],
484         ['OS=="android"', {
485           'dependencies': [
486             'mojo_jni_headers',
487           ],
488         }],
489       ],
490     },
491   ],
492   'conditions': [
493     ['OS=="android"', {
494       'targets': [
495         {
496           'target_name': 'native_viewport_java',
497           'type': 'none',
498           'dependencies': [
499             '../base/base.gyp:base_java',
500           ],
501           'variables': {
502             'java_in_dir': '<(DEPTH)/mojo/services/native_viewport/android',
503           },
504           'includes': [ '../build/java.gypi' ],
505         },
506         {
507           'target_name': 'java_set_jni_headers',
508           'type': 'none',
509           'variables': {
510             'jni_gen_package': 'mojo',
511             'input_java_class': 'java/util/HashSet.class',
512           },
513           'includes': [ '../build/jar_file_jni_generator.gypi' ],
514         },
515         {
516           'target_name': 'mojo_jni_headers',
517           'type': 'none',
518           'dependencies': [
519             'java_set_jni_headers',
520           ],
521           'direct_dependent_settings': {
522             'include_dirs': [
523               '<(SHARED_INTERMEDIATE_DIR)/mojo',
524             ],
525           },
526           'sources': [
527             'services/native_viewport/android/src/org/chromium/mojo/MojoViewport.java',
528             'shell/android/apk/src/org/chromium/mojo_shell_apk/MojoMain.java',
529           ],
530           'variables': {
531             'jni_gen_package': 'mojo'
532           },
533           'includes': [ '../build/jni_generator.gypi' ],
534         },
535         {
536           'target_name': 'libmojo_shell',
537           'type': 'shared_library',
538           'dependencies': [
539             '../base/base.gyp:base',
540             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
541             '../ui/gfx/gfx.gyp:gfx',
542             '../ui/gl/gl.gyp:gl',
543             'mojo_common_lib',
544             'mojo_jni_headers',
545             'mojo_shell_lib',
546           ],
547           'sources': [
548             'shell/android/library_loader.cc',
549             'shell/android/mojo_main.cc',
550             'shell/android/mojo_main.h',
551           ],
552         },
553         {
554           'target_name': 'mojo_shell_apk',
555           'type': 'none',
556           'dependencies': [
557             '../base/base.gyp:base_java',
558             '../net/net.gyp:net_java',
559             'native_viewport_java',
560             'libmojo_shell',
561           ],
562           'variables': {
563             'apk_name': 'MojoShell',
564             'java_in_dir': '<(DEPTH)/mojo/shell/android/apk',
565             'resource_dir': '<(DEPTH)/mojo/shell/android/apk/res',
566             'native_lib_target': 'libmojo_shell',
567           },
568           'includes': [ '../build/java_apk.gypi' ],
569         }
570       ],
571     }],
572   ],