Wire GL_CHROMIUM_map_sub functions up to Skia.
[chromium-blink-merge.git] / mojo / mojo.gyp
blobaf6e853df4aa13b87db154d21def9c40c9850cf6
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_apps_js_unittests',
32         'mojo_bindings',
33         'mojo_compositor_app',
34         'mojo_common_lib',
35         'mojo_common_unittests',
36         'mojo_js',
37         'mojo_js_unittests',
38         'mojo_message_generator',
39         'mojo_native_viewport_service',
40         'mojo_pepper_container_app',
41         'mojo_public_test_utils',
42         'mojo_public_bindings_unittests',
43         'mojo_public_environment_unittests',
44         'mojo_public_system_perftests',
45         'mojo_public_system_unittests',
46         'mojo_public_utility_unittests',
47         'mojo_sample_app',
48         'mojo_service_manager',
49         'mojo_service_manager_unittests',
50         'mojo_shell',
51         'mojo_shell_lib',
52         'mojo_system',
53         'mojo_system_impl',
54         'mojo_system_unittests',
55         'mojo_utility',
56       ],
57       'conditions': [
58         ['use_aura==1', {
59           'dependencies': [
60             'mojo_aura_demo',
61             'mojo_launcher',
62             'mojo_view_manager',
63           ],
64         }],
65       ]
66     },
67     {
68       'target_name': 'mojo_run_all_unittests',
69       'type': 'static_library',
70       'dependencies': [
71         '../base/base.gyp:base',
72         '../base/base.gyp:test_support_base',
73         '../testing/gtest.gyp:gtest',
74         'mojo_system_impl',
75         'mojo_test_support',
76         'mojo_test_support_impl',
77       ],
78       'sources': [
79         'common/test/run_all_unittests.cc',
80       ],
81     },
82     {
83       'target_name': 'mojo_run_all_perftests',
84       'type': 'static_library',
85       'dependencies': [
86         '../base/base.gyp:test_support_base',
87         'mojo_system_impl',
88         'mojo_test_support',
89         'mojo_test_support_impl',
90       ],
91       'sources': [
92         'common/test/run_all_perftests.cc',
93       ],
94     },
95     {
96       'target_name': 'mojo_system_impl',
97       'type': '<(component)',
98       'dependencies': [
99         '../base/base.gyp:base',
100         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
101       ],
102       'defines': [
103         'MOJO_SYSTEM_IMPL_IMPLEMENTATION',
104         'MOJO_SYSTEM_IMPLEMENTATION',
105         'MOJO_USE_SYSTEM_IMPL',
106       ],
107       'sources': [
108         'embedder/embedder.cc',
109         'embedder/embedder.h',
110         'embedder/platform_channel_pair.cc',
111         'embedder/platform_channel_pair.h',
112         'embedder/platform_channel_pair_posix.cc',
113         'embedder/platform_channel_pair_win.cc',
114         'embedder/platform_channel_utils_posix.cc',
115         'embedder/platform_channel_utils_posix.h',
116         'embedder/platform_handle.cc',
117         'embedder/platform_handle.h',
118         'embedder/scoped_platform_handle.h',
119         'system/channel.cc',
120         'system/channel.h',
121         'system/constants.h',
122         'system/core.cc',
123         'system/core.h',
124         'system/data_pipe.cc',
125         'system/data_pipe.h',
126         'system/data_pipe_consumer_dispatcher.cc',
127         'system/data_pipe_consumer_dispatcher.h',
128         'system/data_pipe_producer_dispatcher.cc',
129         'system/data_pipe_producer_dispatcher.h',
130         'system/dispatcher.cc',
131         'system/dispatcher.h',
132         'system/entrypoints.cc',
133         'system/handle_table.cc',
134         'system/handle_table.h',
135         'system/local_data_pipe.cc',
136         'system/local_data_pipe.h',
137         'system/local_message_pipe_endpoint.cc',
138         'system/local_message_pipe_endpoint.h',
139         'system/mapping_table.cc',
140         'system/mapping_table.h',
141         'system/memory.cc',
142         'system/memory.h',
143         'system/message_in_transit.cc',
144         'system/message_in_transit.h',
145         'system/message_in_transit_queue.cc',
146         'system/message_in_transit_queue.h',
147         'system/message_pipe.cc',
148         'system/message_pipe.h',
149         'system/message_pipe_dispatcher.cc',
150         'system/message_pipe_dispatcher.h',
151         'system/message_pipe_endpoint.cc',
152         'system/message_pipe_endpoint.h',
153         'system/proxy_message_pipe_endpoint.cc',
154         'system/proxy_message_pipe_endpoint.h',
155         'system/raw_channel.cc',
156         'system/raw_channel.h',
157         'system/raw_channel_posix.cc',
158         'system/raw_channel_win.cc',
159         'system/raw_shared_buffer.cc',
160         'system/raw_shared_buffer.h',
161         'system/raw_shared_buffer_posix.cc',
162         'system/raw_shared_buffer_win.cc',
163         'system/shared_buffer_dispatcher.cc',
164         'system/shared_buffer_dispatcher.h',
165         'system/simple_dispatcher.cc',
166         'system/simple_dispatcher.h',
167         'system/waiter.cc',
168         'system/waiter.h',
169         'system/waiter_list.cc',
170         'system/waiter_list.h',
171         # Test-only code:
172         # TODO(vtl): It's a little unfortunate that these end up in the same
173         # component as non-test-only code. In the static build, this code should
174         # hopefully be dead-stripped.
175         'embedder/test_embedder.cc',
176         'embedder/test_embedder.h',
177       ],
178       'all_dependent_settings': {
179         # Ensures that dependent projects import the core functions on Windows.
180         'defines': ['MOJO_USE_SYSTEM_IMPL'],
181       }
182     },
183     {
184       'target_name': 'mojo_system_unittests',
185       'type': 'executable',
186       'dependencies': [
187         '../base/base.gyp:base',
188         '../base/base.gyp:run_all_unittests',
189         '../testing/gtest.gyp:gtest',
190         'mojo_common_test_support',
191         'mojo_system_impl',
192       ],
193       'sources': [
194         'embedder/embedder_unittest.cc',
195         'embedder/platform_channel_pair_posix_unittest.cc',
196         'system/core_unittest.cc',
197         'system/core_test_base.cc',
198         'system/core_test_base.h',
199         'system/data_pipe_unittest.cc',
200         'system/dispatcher_unittest.cc',
201         'system/local_data_pipe_unittest.cc',
202         'system/message_pipe_dispatcher_unittest.cc',
203         'system/message_pipe_unittest.cc',
204         'system/multiprocess_message_pipe_unittest.cc',
205         'system/raw_channel_unittest.cc',
206         'system/raw_shared_buffer_unittest.cc',
207         'system/remote_message_pipe_unittest.cc',
208         'system/shared_buffer_dispatcher_unittest.cc',
209         'system/simple_dispatcher_unittest.cc',
210         'system/test_utils.cc',
211         'system/test_utils.h',
212         'system/waiter_list_unittest.cc',
213         'system/waiter_test_utils.cc',
214         'system/waiter_test_utils.h',
215         'system/waiter_unittest.cc',
216       ],
217     },
218     {
219       'target_name': 'mojo_gles2_impl',
220       'type': '<(component)',
221       'dependencies': [
222         '../base/base.gyp:base',
223         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
224         '../gpu/gpu.gyp:command_buffer_client',
225         '../gpu/gpu.gyp:command_buffer_common',
226         '../gpu/gpu.gyp:gles2_cmd_helper',
227         '../gpu/gpu.gyp:gles2_implementation',
228         'mojo_gles2',
229         'mojo_gles2_bindings',
230         'mojo_environment_chromium',
231         'mojo_system_impl',
232       ],
233       'defines': [
234         'MOJO_GLES2_IMPL_IMPLEMENTATION',
235       ],
236       'sources': [
237         'gles2/command_buffer_client_impl.cc',
238         'gles2/command_buffer_client_impl.h',
239         'gles2/gles2_impl_export.h',
240         'gles2/gles2_support_impl.cc',
241         'gles2/gles2_support_impl.h',
242         'gles2/gles2_context.cc',
243         'gles2/gles2_context.h',
244       ],
245     },
246     {
247       'target_name': 'mojo_test_support_impl',
248       'type': 'static_library',
249       'dependencies': [
250         '../base/base.gyp:base',
251       ],
252       'sources': [
253         'common/test/test_support_impl.cc',
254         'common/test/test_support_impl.h',
255       ],
256     },
257     {
258       'target_name': 'mojo_common_lib',
259       'type': '<(component)',
260       'defines': [
261         'MOJO_COMMON_IMPLEMENTATION',
262       ],
263       'dependencies': [
264         '../base/base.gyp:base',
265         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
266         'mojo_system_impl',
267       ],
268       'export_dependent_settings': [
269         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
270         'mojo_system_impl',
271       ],
272       'sources': [
273         'common/common_type_converters.cc',
274         'common/common_type_converters.h',
275         'common/environment_data.cc',
276         'common/environment_data.h',
277         'common/handle_watcher.cc',
278         'common/handle_watcher.h',
279         'common/message_pump_mojo.cc',
280         'common/message_pump_mojo.h',
281         'common/message_pump_mojo_handler.h',
282         'common/mojo_channel_init.cc',
283         'common/mojo_channel_init.h',
284         'common/time_helper.cc',
285         'common/time_helper.h',
286       ],
287     },
288     {
289       'target_name': 'mojo_common_test_support',
290       'type': 'static_library',
291       'dependencies': [
292         '../base/base.gyp:base',
293         '../base/base.gyp:test_support_base',
294         '../testing/gtest.gyp:gtest',
295         'mojo_system_impl',
296       ],
297       'sources': [
298         'common/test/multiprocess_test_helper.cc',
299         'common/test/multiprocess_test_helper.h',
300         'common/test/test_utils.h',
301         'common/test/test_utils_posix.cc',
302         'common/test/test_utils_win.cc',
303       ],
304     },
305     {
306       'target_name': 'mojo_common_unittests',
307       'type': 'executable',
308       'dependencies': [
309         '../base/base.gyp:base',
310         '../base/base.gyp:base_message_loop_tests',
311         '../testing/gtest.gyp:gtest',
312         'mojo_bindings',
313         'mojo_environment_chromium',
314         'mojo_common_lib',
315         'mojo_common_test_support',
316         'mojo_public_test_utils',
317         'mojo_run_all_unittests',
318       ],
319       'sources': [
320         'common/common_type_converters_unittest.cc',
321         'common/handle_watcher_unittest.cc',
322         'common/message_pump_mojo_unittest.cc',
323         'common/test/multiprocess_test_helper_unittest.cc',
324       ],
325     },
326     {
327       'target_name': 'mojo_environment_chromium',
328       'type': 'static_library',
329       'dependencies': [
330         'mojo_common_lib',
331         'mojo_environment_chromium_impl',
332       ],
333       'sources': [
334         'environment/default_async_waiter.cc',
335         'environment/buffer_tls.cc',
336         'environment/environment.cc',
337       ],
338       'include_dirs': [
339         '..',
340       ],
341       'export_dependent_settings': [
342         'mojo_environment_chromium_impl',
343       ],
344     },
345     {
346       'target_name': 'mojo_environment_chromium_impl',
347       'type': '<(component)',
348       'defines': [
349         'MOJO_ENVIRONMENT_IMPL_IMPLEMENTATION',
350       ],
351       'dependencies': [
352         '../base/base.gyp:base',
353         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
354         'mojo_common_lib'
355       ],
356       'sources': [
357         'environment/default_async_waiter_impl.cc',
358         'environment/default_async_waiter_impl.h',
359         'environment/buffer_tls_impl.cc',
360         'environment/buffer_tls_impl.h',
361       ],
362       'include_dirs': [
363         '..',
364       ],
365     },
366     {
367       'target_name': 'mojo_service_manager',
368       'type': '<(component)',
369       'defines': [
370         'MOJO_SERVICE_MANAGER_IMPLEMENTATION',
371       ],
372       'dependencies': [
373         '../base/base.gyp:base',
374         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
375         '../net/net.gyp:net',
376         '../url/url.gyp:url_lib',
377         'mojo_common_lib',
378         'mojo_environment_chromium',
379         'mojo_shell_bindings',
380         'mojo_system_impl',
381       ],
382       'sources': [
383         'service_manager/service_loader.h',
384         'service_manager/service_manager.cc',
385         'service_manager/service_manager.h',
386         'service_manager/service_manager_export.h',
387       ],
388       'export_dependent_settings': [
389         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
390         'mojo_shell_bindings',
391       ],
392     },
393     {
394       'target_name': 'mojo_spy',
395       'type': 'static_library',
396       'dependencies': [
397         '../base/base.gyp:base',
398         '../base/base.gyp:base_static',
399         '../url/url.gyp:url_lib',
400         'mojo_service_manager',
401       ],
402       'sources': [
403         'spy/spy.cc',
404         'spy/spy.h',
405       ],
406     },
407     {
408       'target_name': 'mojo_shell_lib',
409       'type': 'static_library',
410       'dependencies': [
411         '../base/base.gyp:base',
412         '../base/base.gyp:base_static',
413         '../net/net.gyp:net',
414         '../url/url.gyp:url_lib',
415         'mojo_gles2_impl',
416         'mojo_service_manager',
417         'mojo_shell_bindings',
418         'mojo_system_impl',
419         'mojo_native_viewport_service',
420         'mojo_spy',
421       ],
422       'variables': {
423         'mojom_base_output_dir': 'mojo',
424       },
425       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
426       'sources': [
427         'shell/app_child_process.cc',
428         'shell/app_child_process.h',
429         'shell/app_child_process.mojom',
430         'shell/app_child_process_host.cc',
431         'shell/app_child_process_host.h',
432         'shell/child_process.cc',
433         'shell/child_process.h',
434         'shell/child_process_host.cc',
435         'shell/child_process_host.h',
436         'shell/context.cc',
437         'shell/context.h',
438         'shell/dynamic_service_loader.cc',
439         'shell/dynamic_service_loader.h',
440         'shell/dynamic_service_runner.h',
441         'shell/init.cc',
442         'shell/init.h',
443         'shell/in_process_dynamic_service_runner.cc',
444         'shell/in_process_dynamic_service_runner.h',
445         'shell/keep_alive.cc',
446         'shell/keep_alive.h',
447         'shell/loader.cc',
448         'shell/loader.h',
449         'shell/network_delegate.cc',
450         'shell/network_delegate.h',
451         'shell/out_of_process_dynamic_service_runner.cc',
452         'shell/out_of_process_dynamic_service_runner.h',
453         'shell/run.cc',
454         'shell/run.h',
455         'shell/storage.cc',
456         'shell/storage.h',
457         'shell/switches.cc',
458         'shell/switches.h',
459         'shell/task_runners.cc',
460         'shell/task_runners.h',
461         'shell/test_child_process.cc',
462         'shell/test_child_process.h',
463         'shell/url_request_context_getter.cc',
464         'shell/url_request_context_getter.h',
465       ],
466     },
467     {
468       'target_name': 'mojo_shell',
469       'type': 'executable',
470       'dependencies': [
471         '../base/base.gyp:base',
472         '../ui/gl/gl.gyp:gl',
473         '../url/url.gyp:url_lib',
474         'mojo_common_lib',
475         'mojo_environment_chromium',
476         'mojo_service_manager',
477         'mojo_shell_lib',
478         'mojo_system_impl',
479       ],
480       'sources': [
481         'shell/desktop/mojo_main.cc',
482       ],
483     },
484     {
485       'target_name': 'mojo_service_manager_unittests',
486       'type': 'executable',
487       'dependencies': [
488         '../base/base.gyp:base',
489         '../testing/gtest.gyp:gtest',
490         '../url/url.gyp:url_lib',
491         'mojo_bindings',
492         'mojo_common_lib',
493         'mojo_environment_chromium',
494         'mojo_run_all_unittests',
495         'mojo_service_manager',
496         'mojo_shell_client',
497       ],
498       'variables': {
499         'mojom_base_output_dir': 'mojo',
500       },
501       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
502       'sources': [
503         'service_manager/service_manager_unittest.cc',
504         'service_manager/test.mojom',
505       ],
506     },
507     {
508       'target_name': 'mojo_js_bindings_lib',
509       'type': 'static_library',
510       'dependencies': [
511         '../base/base.gyp:base',
512         '../gin/gin.gyp:gin',
513         '../v8/tools/gyp/v8.gyp:v8',
514         'mojo_common_lib',
515       ],
516       'export_dependent_settings': [
517         '../base/base.gyp:base',
518         '../gin/gin.gyp:gin',
519         'mojo_common_lib',
520       ],
521       'sources': [
522         'bindings/js/core.cc',
523         'bindings/js/core.h',
524         'bindings/js/handle.cc',
525         'bindings/js/handle.h',
526         'bindings/js/support.cc',
527         'bindings/js/support.h',
528         'bindings/js/unicode.cc',
529         'bindings/js/unicode.h',
530         'bindings/js/waiting_callback.cc',
531         'bindings/js/waiting_callback.h',
532       ],
533     },
534     {
535       'target_name': 'mojo_js_unittests',
536       'type': 'executable',
537       'dependencies': [
538         '../gin/gin.gyp:gin_test',
539         'mojo_js_bindings_lib',
540         'mojo_run_all_unittests',
541         'mojo_public_test_interfaces',
542       ],
543       'sources': [
544         'bindings/js/run_js_tests.cc',
545       ],
546     },
547     {
548       'target_name': 'mojo_message_generator',
549       'type': 'executable',
550       'dependencies': [
551         '../base/base.gyp:base',
552         '../testing/gtest.gyp:gtest',
553         'mojo_bindings',
554         'mojo_common_lib',
555         'mojo_environment_chromium',
556         'mojo_system_impl',
557       ],
558       'sources': [
559         'tools/message_generator.cc',
560       ],
561     },
562   ],
563   'conditions': [
564     ['OS=="android"', {
565       'targets': [
566         {
567           'target_name': 'mojo_native_viewport_java',
568           'type': 'none',
569           'dependencies': [
570             '../base/base.gyp:base_java',
571           ],
572           'variables': {
573             'java_in_dir': '<(DEPTH)/mojo/services/native_viewport/android',
574           },
575           'includes': [ '../build/java.gypi' ],
576         },
577         {
578           'target_name': 'mojo_java_set_jni_headers',
579           'type': 'none',
580           'variables': {
581             'jni_gen_package': 'mojo',
582             'jni_generator_ptr_type': 'long',
583             'input_java_class': 'java/util/HashSet.class',
584           },
585           'includes': [ '../build/jar_file_jni_generator.gypi' ],
586         },
587         {
588           'target_name': 'mojo_jni_headers',
589           'type': 'none',
590           'dependencies': [
591             'mojo_java_set_jni_headers',
592           ],
593           'sources': [
594             'services/native_viewport/android/src/org/chromium/mojo/NativeViewportAndroid.java',
595             'shell/android/apk/src/org/chromium/mojo_shell_apk/MojoMain.java',
596           ],
597           'variables': {
598             'jni_gen_package': 'mojo',
599             'jni_generator_ptr_type': 'long',
600          },
601           'includes': [ '../build/jni_generator.gypi' ],
602         },
603         {
604           'target_name': 'libmojo_shell',
605           'type': 'shared_library',
606           'dependencies': [
607             '../base/base.gyp:base',
608             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
609             '../ui/gfx/gfx.gyp:gfx',
610             '../ui/gfx/gfx.gyp:gfx_geometry',
611             '../ui/gl/gl.gyp:gl',
612             'mojo_common_lib',
613             'mojo_environment_chromium',
614             'mojo_jni_headers',
615             'mojo_shell_bindings',
616             'mojo_shell_lib',
617           ],
618           'sources': [
619             'shell/android/library_loader.cc',
620             'shell/android/mojo_main.cc',
621             'shell/android/mojo_main.h',
622           ],
623         },
624         {
625           'target_name': 'mojo_shell_apk',
626           'type': 'none',
627           'dependencies': [
628             '../base/base.gyp:base_java',
629             '../net/net.gyp:net_java',
630             'mojo_native_viewport_java',
631             'libmojo_shell',
632           ],
633           'variables': {
634             'apk_name': 'MojoShell',
635             'java_in_dir': '<(DEPTH)/mojo/shell/android/apk',
636             'resource_dir': '<(DEPTH)/mojo/shell/android/apk/res',
637             'native_lib_target': 'libmojo_shell',
638           },
639           'includes': [ '../build/java_apk.gypi' ],
640         }
641       ],
642     }],
643     ['test_isolation_mode != "noop"', {
644       'targets': [
645         {
646           'target_name': 'mojo_js_unittests_run',
647           'type': 'none',
648           'dependencies': [
649             'mojo_js_unittests',
650           ],
651           'includes': [
652             '../build/isolate.gypi',
653             'mojo_js_unittests.isolate',
654           ],
655           'sources': [
656             'mojo_js_unittests.isolate',
657           ],
658         },
659       ],
660     }],
661   ],