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