move build flags into chrome's SkUserConfig
[chromium-blink-merge.git] / mojo / mojo.gyp
blobd8bb822f866096b5b09d8515143e9564c1e11c61
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   'includes': [
17     'mojo_apps.gypi',
18     'mojo_examples.gypi',
19     'mojo_services.gypi',
20     'mojo_variables.gypi',
21   ],
22   'targets': [
23     {
24       # GN version: //mojo
25       'target_name': 'mojo',
26       'type': 'none',
27       'dependencies': [
28         'mojo_application_manager',
29         'mojo_application_manager_unittests',
30         'mojo_apps_js_unittests',
31         'mojo_base.gyp:mojo_base',
32         'mojo_clipboard',
33         'mojo_clipboard_unittests',
34         'mojo_compositor_app',
35         'mojo_content_handler_demo',
36         'mojo_echo_client',
37         'mojo_echo_service',
38         'mojo_example_apptests',
39         'mojo_example_service',
40         'mojo_geometry_lib',
41         'mojo_html_viewer',
42         'mojo_js',
43         'mojo_native_viewport_service',
44         'mojo_network_service',
45         'mojo_pepper_container_app',
46         'mojo_png_viewer',
47         'mojo_sample_app',
48         'mojo_shell',
49         'mojo_shell_lib',
50         'mojo_shell_tests',
51         'mojo_surfaces_app',
52         'mojo_surfaces_app',
53         'mojo_surfaces_child_app',
54         'mojo_surfaces_child_gl_app',
55         'mojo_surfaces_lib',
56         'mojo_surfaces_lib_unittests',
57         'mojo_surfaces_service',
58         'mojo_test_app',
59         'mojo_test_request_tracker_app',
60         'mojo_view_manager_lib',
61         'mojo_view_manager_lib_unittests',
62         'mojo_wget',
63       ],
64       'conditions': [
65         ['use_aura==1', {
66           'dependencies': [
67             'mojo_aura_demo',
68             'mojo_aura_demo_init',
69             'mojo_browser',
70             'mojo_core_window_manager',
71             'mojo_core_window_manager_unittests',
72             'mojo_demo_launcher',
73             'mojo_embedded_app',
74             'mojo_keyboard',
75             'mojo_media_viewer',
76             'mojo_nesting_app',
77             'mojo_window_manager',
78             'mojo_wm_flow_app',
79             'mojo_wm_flow_embedded',
80             'mojo_wm_flow_init',
81             'mojo_wm_flow_wm',
82             'mojo_view_manager',
83             'mojo_view_manager_unittests',
84           ],
85         }],
86         ['OS == "linux"', {
87           'dependencies': [
88             'mojo_dbus_echo',
89             'mojo_dbus_echo_service',
90           ],
91         }],
92         ['component != "shared_library" and OS == "linux"', {
93           'dependencies': [
94             'mojo_python_bindings',
95             'mojo_python_embedder',
96             'mojo_python_system',
97             'mojo_python',
98           ],
99         }],
100       ]
101     },
102     {
103       # GN version: //mojo/shell:external_service_bindings
104       'target_name': 'mojo_external_service_bindings',
105       'type': 'static_library',
106       'sources': [
107         'shell/external_service.mojom',
108       ],
109       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
110       'export_dependent_settings': [
111         'mojo_base.gyp:mojo_cpp_bindings',
112       ],
113       'dependencies': [
114         'mojo_base.gyp:mojo_cpp_bindings',
115       ],
116     },
117     {
118       # GN version: //mojo/spy
119       'target_name': 'mojo_spy',
120       'type': 'static_library',
121       'dependencies': [
122         '../base/base.gyp:base',
123         '../base/base.gyp:base_static',
124         '../net/net.gyp:http_server',
125         '../url/url.gyp:url_lib',
126         'mojo_application_manager',
127       ],
128       'variables': {
129         'mojom_base_output_dir': 'mojo',
130       },
131       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
132       'sources': [
133         'spy/public/spy.mojom',
134         'spy/common.h',
135         'spy/spy.cc',
136         'spy/spy.h',
137         'spy/spy_server_impl.h',
138         'spy/spy_server_impl.cc',
139         'spy/websocket_server.cc',
140         'spy/websocket_server.h',
141       ],
142     },
143     {
144       # GN version: //mojo/shell:lib
145       'target_name': 'mojo_shell_lib',
146       'type': 'static_library',
147       'dependencies': [
148         '../base/base.gyp:base',
149         '../base/base.gyp:base_static',
150         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
151         'mojo_application_manager',
152         'mojo_base.gyp:mojo_application_bindings',
153         'mojo_base.gyp:mojo_common_lib',
154         'mojo_base.gyp:mojo_gles2_impl',
155         'mojo_base.gyp:mojo_system_impl',
156         'mojo_base.gyp:mojo_application_chromium',
157         'mojo_external_service_bindings',
158         'mojo_network_bindings',
159         'mojo_spy',
160       ],
161       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
162       'sources': [
163         'shell/app_child_process.cc',
164         'shell/app_child_process.h',
165         'shell/app_child_process.mojom',
166         'shell/app_child_process_host.cc',
167         'shell/app_child_process_host.h',
168         'shell/child_process.cc',
169         'shell/child_process.h',
170         'shell/child_process_host.cc',
171         'shell/child_process_host.h',
172         'shell/context.cc',
173         'shell/context.h',
174         'shell/dbus_application_loader_linux.cc',
175         'shell/dbus_application_loader_linux.h',
176         'shell/dynamic_application_loader.cc',
177         'shell/dynamic_application_loader.h',
178         'shell/dynamic_service_runner.h',
179         'shell/init.cc',
180         'shell/init.h',
181         'shell/in_process_dynamic_service_runner.cc',
182         'shell/in_process_dynamic_service_runner.h',
183         'shell/mojo_url_resolver.cc',
184         'shell/mojo_url_resolver.h',
185         'shell/out_of_process_dynamic_service_runner.cc',
186         'shell/out_of_process_dynamic_service_runner.h',
187         'shell/switches.cc',
188         'shell/switches.h',
189         'shell/task_runners.cc',
190         'shell/task_runners.h',
191         'shell/test_child_process.cc',
192         'shell/test_child_process.h',
193         'shell/ui_application_loader_android.cc',
194         'shell/ui_application_loader_android.h',
195       ],
196       'conditions': [
197         ['component=="shared_library"', {
198           'dependencies': [
199             '../ui/gl/gl.gyp:gl',
200           ],
201         }],
202         ['OS=="linux"', {
203           'dependencies': [
204             '../build/linux/system.gyp:dbus',
205             '../dbus/dbus.gyp:dbus',
206           ],
207         }],
208         ['OS=="android"', {
209           'dependencies': [
210             'mojo_network_service_lib',
211             'mojo_native_viewport_service_lib',
212           ],
213           'sources': [
214             'shell/network_application_loader.cc',
215             'shell/network_application_loader.h',
216           ],
217         }],
218       ],
219     },
220     {
221       # GN version: //mojo/shell:test_support
222       'target_name': 'mojo_shell_test_support',
223       'type': 'static_library',
224       'dependencies': [
225         '../base/base.gyp:base_static',
226         'mojo_base.gyp:mojo_system_impl',
227         'mojo_shell_lib',
228       ],
229       'sources': [
230         'shell/shell_test_helper.cc',
231         'shell/shell_test_helper.h',
232       ],
233     },
234     {
235       # GN version: //mojo/shell
236       'target_name': 'mojo_shell',
237       'type': 'executable',
238       'dependencies': [
239         '../base/base.gyp:base',
240         'mojo_base.gyp:mojo_common_lib',
241         'mojo_base.gyp:mojo_environment_chromium',
242         'mojo_shell_lib',
243       ],
244       'sources': [
245         'shell/desktop/mojo_main.cc',
246       ],
247       'conditions': [
248         ['component=="shared_library"', {
249           'dependencies': [
250             '../ui/gfx/gfx.gyp:gfx',
251           ],
252         }],
253       ],
254     },
255     {
256       # GN version: //mojo/shell:mojo_shell_tests
257       'target_name': 'mojo_shell_tests',
258       'type': '<(gtest_target_type)',
259       'dependencies': [
260         '../base/base.gyp:base',
261         '../base/base.gyp:base_i18n',
262         '../base/base.gyp:test_support_base',
263         '../testing/gtest.gyp:gtest',
264         '../net/net.gyp:net_test_support',
265         '../url/url.gyp:url_lib',
266         'mojo_application_manager',
267         'mojo_base.gyp:mojo_common_lib',
268         'mojo_base.gyp:mojo_environment_chromium',
269         'mojo_base.gyp:mojo_system_impl',
270         'mojo_shell_lib',
271         'mojo_test_app',
272         'mojo_test_request_tracker_app',
273         'mojo_test_service_bindings',
274       ],
275       'sources': [
276         'shell/child_process_host_unittest.cc',
277         'shell/dynamic_application_loader_unittest.cc',
278         'shell/in_process_dynamic_service_runner_unittest.cc',
279         'shell/shell_test_base.cc',
280         'shell/shell_test_base.h',
281         'shell/shell_test_base_unittest.cc',
282         'shell/shell_test_main.cc',
283       ],
284       'conditions': [
285         ['OS == "android"', {
286           'dependencies': [
287             '../testing/android/native_test.gyp:native_test_native_code',
288           ],
289         }],
290       ],
291     },
292     {
293       # GN version: //mojo/application_manager
294       'target_name': 'mojo_application_manager',
295       'type': '<(component)',
296       'defines': [
297         'MOJO_APPLICATION_MANAGER_IMPLEMENTATION',
298       ],
299       'dependencies': [
300         '../base/base.gyp:base',
301         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
302         '../url/url.gyp:url_lib',
303         'mojo_content_handler_bindings',
304         'mojo_network_bindings',
305         'mojo_base.gyp:mojo_application_bindings',
306         'mojo_base.gyp:mojo_common_lib',
307         'mojo_base.gyp:mojo_environment_chromium',
308         '<(mojo_system_for_component)',
309       ],
310       'sources': [
311         'application_manager/application_loader.cc',
312         'application_manager/application_loader.h',
313         'application_manager/application_manager.cc',
314         'application_manager/application_manager.h',
315         'application_manager/application_manager_export.h',
316         'application_manager/background_shell_application_loader.cc',
317         'application_manager/background_shell_application_loader.h',
318       ],
319       'export_dependent_settings': [
320         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
321         'mojo_base.gyp:mojo_application_bindings',
322         'mojo_network_bindings',
323       ],
324     },
325     {
326       # GN version: //mojo/application_manager:unittests
327       'target_name': 'mojo_application_manager_unittests',
328       'type': 'executable',
329       'dependencies': [
330         '../base/base.gyp:base',
331         '../testing/gtest.gyp:gtest',
332         '../url/url.gyp:url_lib',
333         'mojo_application_manager',
334         'mojo_base.gyp:mojo_common_lib',
335         'mojo_base.gyp:mojo_cpp_bindings',
336         'mojo_base.gyp:mojo_environment_chromium',
337         'mojo_base.gyp:mojo_run_all_unittests',
338         'mojo_base.gyp:mojo_application_chromium',
339       ],
340       'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
341       'sources': [
342         'application_manager/application_manager_unittest.cc',
343         'application_manager/background_shell_application_loader_unittest.cc',
344         'application_manager/test.mojom',
345       ],
346     },
347     {
348       # GN version: //mojo/cc
349       'target_name': 'mojo_cc_support',
350       'type': 'static_library',
351       'dependencies': [
352         '../base/base.gyp:base',
353         '../cc/cc.gyp:cc',
354         '../cc/cc.gyp:cc_surfaces',
355         '../skia/skia.gyp:skia',
356         '../gpu/gpu.gyp:gles2_implementation',
357         'mojo_geometry_lib',
358         'mojo_surfaces_bindings',
359         'mojo_surfaces_lib',
360       ],
361       'includes': [
362         'mojo_public_gles2_for_loadable_module.gypi',
363       ],
364       'export_dependent_settings': [
365         'mojo_surfaces_bindings',
366       ],
367       'sources': [
368         'cc/context_provider_mojo.cc',
369         'cc/context_provider_mojo.h',
370         'cc/output_surface_mojo.cc',
371         'cc/output_surface_mojo.h',
372       ],
373     },
374   ],
375   'conditions': [
376     ['OS=="android"', {
377       'targets': [
378         {
379           'target_name': 'mojo_native_viewport_java',
380           'type': 'none',
381           'dependencies': [
382             '../base/base.gyp:base_java',
383           ],
384           'variables': {
385             'java_in_dir': '<(DEPTH)/mojo/services/native_viewport/android',
386           },
387           'includes': [ '../build/java.gypi' ],
388         },
389         {
390           'target_name': 'libmojo_shell',
391           'type': 'shared_library',
392           'dependencies': [
393             '../base/base.gyp:base',
394             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
395             '../ui/gfx/gfx.gyp:gfx',
396             '../ui/gfx/gfx.gyp:gfx_geometry',
397             '../ui/gl/gl.gyp:gl',
398             'mojo_base.gyp:mojo_application_bindings',
399             'mojo_base.gyp:mojo_common_lib',
400             'mojo_base.gyp:mojo_environment_chromium',
401             'mojo_base.gyp:mojo_jni_headers',
402             'mojo_shell_lib',
403           ],
404           'sources': [
405             'shell/android/library_loader.cc',
406             'shell/android/mojo_main.cc',
407             'shell/android/mojo_main.h',
408           ],
409         },
410         {
411           'target_name': 'mojo_shell_apk',
412           'type': 'none',
413           'dependencies': [
414             '../base/base.gyp:base_java',
415             '../net/net.gyp:net_java',
416             'mojo_native_viewport_java',
417             'libmojo_shell',
418           ],
419           'variables': {
420             'apk_name': 'MojoShell',
421             'java_in_dir': '<(DEPTH)/mojo/shell/android/apk',
422             'resource_dir': '<(DEPTH)/mojo/shell/android/apk/res',
423             'native_lib_target': 'libmojo_shell',
424           },
425           'includes': [ '../build/java_apk.gypi' ],
426         }
427       ],
428     }],
429     ['OS=="linux"', {
430       'targets': [
431         {
432           # GN version: //mojo/dbus
433           'target_name': 'mojo_dbus_service',
434           'type': 'static_library',
435           'dependencies': [
436             '../base/base.gyp:base',
437             '../build/linux/system.gyp:dbus',
438             '../dbus/dbus.gyp:dbus',
439             'mojo_base.gyp:mojo_application_chromium',
440             'mojo_base.gyp:mojo_common_lib',
441             'mojo_base.gyp:mojo_system_impl',
442             'mojo_external_service_bindings',
443           ],
444           'sources': [
445             'dbus/dbus_external_service.h',
446             'dbus/dbus_external_service.cc',
447           ],
448         },
449       ],
450     }],
451     ['use_aura==1', {
452       'targets': [
453         {
454           # GN version: //mojo/aura
455           'target_name': 'mojo_aura_support',
456           'type': 'static_library',
457           'dependencies': [
458             '../cc/cc.gyp:cc',
459             '../ui/aura/aura.gyp:aura',
460             '../ui/compositor/compositor.gyp:compositor',
461             '../ui/events/events.gyp:events',
462             '../ui/events/events.gyp:events_base',
463             '../webkit/common/gpu/webkit_gpu.gyp:webkit_gpu',
464             'mojo_cc_support',
465             'mojo_native_viewport_bindings',
466           ],
467           'includes': [
468             'mojo_public_gles2_for_loadable_module.gypi',
469           ],
470           'sources': [
471             'aura/aura_init.cc',
472             'aura/aura_init.h',
473             'aura/context_factory_mojo.cc',
474             'aura/context_factory_mojo.h',
475             'aura/screen_mojo.cc',
476             'aura/screen_mojo.h',
477             'aura/window_tree_host_mojo.cc',
478             'aura/window_tree_host_mojo.h',
479             'aura/window_tree_host_mojo_delegate.h',
480           ],
481         },
482         {
483           # GN version: //mojo/views
484           'target_name': 'mojo_views_support',
485           'type': 'static_library',
486           'dependencies': [
487             '../base/base.gyp:base',
488             '../base/base.gyp:base_i18n',
489             '../skia/skia.gyp:skia',
490             '../third_party/icu/icu.gyp:icui18n',
491             '../third_party/icu/icu.gyp:icuuc',
492             '../ui/aura/aura.gyp:aura',
493             '../ui/base/ui_base.gyp:ui_base',
494             '../ui/views/views.gyp:views',
495             '../ui/wm/wm.gyp:wm',
496             'mojo_aura_support',
497             'mojo_views_support_internal',
498             'mojo_view_manager_bindings',
499           ],
500           'sources': [
501             'views/input_method_mojo_linux.cc',
502             'views/input_method_mojo_linux.h',
503             'views/native_widget_view_manager.cc',
504             'views/native_widget_view_manager.h',
505             'views/views_init.cc',
506             'views/views_init.h',
507           ],
508         },
509         {
510           # GN version: //mojo/views:views_internal
511           'target_name': 'mojo_views_support_internal',
512           'type': '<(component)',
513           'dependencies': [
514             '../base/base.gyp:base',
515             '../base/base.gyp:base_i18n',
516             '../base/base.gyp:base_static',
517             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
518             '../skia/skia.gyp:skia',
519             '../third_party/icu/icu.gyp:icui18n',
520             '../third_party/icu/icu.gyp:icuuc',
521             '../ui/base/ui_base.gyp:ui_base',
522             '../ui/gfx/gfx.gyp:gfx',
523           ],
524           'sources': [
525             'views/mojo_views_export.h',
526             'views/views_init_internal.cc',
527             'views/views_init_internal.h',
528           ],
529           'defines': [
530             'MOJO_VIEWS_IMPLEMENTATION',
531           ],
532         },
533       ],
534     }],
535     ['component!="shared_library" and OS=="linux"', {
536       'targets': [
537         {
538           # GN version: //mojo/public/python:system
539           'target_name': 'mojo_python_system',
540           'variables': {
541             'python_base_module': 'mojo',
542             'python_cython_module': 'system',
543           },
544           'sources': [
545             'public/python/mojo/c_core.pxd',
546             'public/python/mojo/c_environment.pxd',
547             'public/python/mojo/system.pyx',
548             'public/python/src/python_system_helper.cc',
549             'public/python/src/python_system_helper.h',
550           ],
551           'dependencies': [
552             'mojo_base.gyp:mojo_environment_standalone',
553             'mojo_base.gyp:mojo_system',
554             'mojo_base.gyp:mojo_utility',
555           ],
556           'includes': [ '../third_party/cython/cython_compiler.gypi' ],
557         },
558         {
559           # GN version: //mojo/python:embedder
560           'target_name': 'mojo_python_embedder',
561           'type': 'loadable_module',
562           'variables': {
563             'python_base_module': 'mojo',
564             'python_cython_module': 'embedder',
565           },
566           'sources': [
567             'python/system/mojo/embedder.pyx',
568           ],
569           'dependencies': [
570             'mojo_base.gyp:mojo_system_impl',
571           ],
572           'includes': [ '../third_party/cython/cython_compiler.gypi' ],
573         },
574         {
575           # GN version: //mojo/public/python:bindings
576           'target_name': 'mojo_python_bindings',
577           'type': 'none',
578           'variables': {
579             'python_base_module': 'mojo/bindings',
580           },
581           'sources': [
582             'public/python/mojo/bindings/__init__.py',
583             'public/python/mojo/bindings/descriptor.py',
584             'public/python/mojo/bindings/reflection.py',
585             'public/python/mojo/bindings/serialization.py',
586           ],
587           'dependencies': [
588             'mojo_python_system',
589           ],
590           'includes': [ '../third_party/cython/python_module.gypi' ],
591         },
592         {
593           # GN version: //mojo/python
594           'target_name': 'mojo_python',
595           'type': 'none',
596           'variables': {
597             'python_base_module': 'mojo',
598           },
599           'sources': [
600             'public/python/mojo/__init__.py',
601           ],
602           'dependencies': [
603             'mojo_python_bindings',
604             'mojo_python_embedder',
605             'mojo_python_system',
606           ],
607           # The python module need to be copied to their destinations
608           'actions': [
609             {
610               'action_name': 'Copy system module.',
611               'inputs': [
612                 '<(DEPTH)/build/cp.py',
613                 '<(PRODUCT_DIR)/libmojo_python_system.so',
614               ],
615               'outputs': [
616                 '<(PRODUCT_DIR)/python/mojo/system.so',
617               ],
618               'action': [
619                 'python',
620                 '<@(_inputs)',
621                 '<@(_outputs)',
622               ]
623             },
624             {
625               'action_name': 'Copy embedder module.',
626               'inputs': [
627                 '<(DEPTH)/build/cp.py',
628                 '<(PRODUCT_DIR)/libmojo_python_embedder.so',
629               ],
630               'outputs': [
631                 '<(PRODUCT_DIR)/python/mojo/embedder.so',
632               ],
633               'action': [
634                 'python',
635                 '<@(_inputs)',
636                 '<@(_outputs)',
637               ]
638             },
639           ],
640           'includes': [ '../third_party/cython/python_module.gypi' ],
641         },
642       ],
643     }],
644     ['component!="shared_library" and OS=="linux" and test_isolation_mode!="noop"', {
645       'targets': [
646         {
647           'target_name': 'mojo_python_unittests_run',
648           'type': 'none',
649           'dependencies': [
650             'mojo_python',
651             'mojo_base.gyp:mojo_public_test_interfaces',
652           ],
653           'includes': [
654             '../build/isolate.gypi',
655             'mojo_python_unittests.isolate',
656           ],
657           'sources': [
658             'mojo_python_unittests.isolate',
659           ],
660         },
661       ],
662     }],
663   ],