Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / mojo / mojo_base.gyp
blob550c41d55043c861ad72b8064c0f411ea246518d
1 # Copyright 2014 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.
5 # Essential components (and their tests) that are needed to build
6 # Chrome should be here.  Other components that are useful only in
7 # Mojo land like mojo_shell should be in mojo.gyp.
9   'includes': [
10     '../third_party/mojo/mojo_variables.gypi',
11   ],
12   'targets': [
13     {
14       'target_name': 'mojo_base',
15       'type': 'none',
16       'dependencies': [
17         # NOTE: If adding a new dependency here, please consider whether it
18         # should also be added to the list of Mojo-related dependencies of
19         # build/all.gyp:All on iOS, as All cannot depend on the mojo_base
20         # target on iOS due to the presence of the js targets, which cause v8
21         # to be built.
22         'mojo_common_lib',
23         'mojo_common_unittests',
24       ],
25       'conditions': [
26         ['OS == "android"', {
27           'dependencies': [
28             '../third_party/mojo/mojo_public.gyp:mojo_bindings_java',
29             '../third_party/mojo/mojo_public.gyp:mojo_public_java',
30           ],
31         }],
32       ]
33     },
34     {
35       'target_name': 'mojo_none',
36       'type': 'none',
37     },
38     {
39       # GN version: //mojo/common
40       'target_name': 'mojo_common_lib',
41       'type': '<(component)',
42       'defines': [
43         'MOJO_COMMON_IMPLEMENTATION',
44       ],
45       'dependencies': [
46         '../base/base.gyp:base',
47         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
48         '<(mojo_system_for_component)',
49       ],
50       'export_dependent_settings': [
51         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
52       ],
53       'sources': [
54         'common/common_type_converters.cc',
55         'common/common_type_converters.h',
56         'common/data_pipe_file_utils.cc',
57         'common/data_pipe_utils.cc',
58         'common/data_pipe_utils.h',
59         'common/handle_watcher.cc',
60         'common/handle_watcher.h',
61         'common/message_pump_mojo.cc',
62         'common/message_pump_mojo.h',
63         'common/message_pump_mojo_handler.h',
64         'common/time_helper.cc',
65         'common/time_helper.h',
66       ],
67     },
68     {
69       # GN version: //mojo/common:url_type_converters
70       'target_name': 'mojo_url_type_converters',
71       'type': 'static_library',
72       'dependencies': [
73         '../base/base.gyp:base',
74         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
75         '../url/url.gyp:url_lib',
76         '<(mojo_system_for_component)',
77       ],
78       'export_dependent_settings': [
79         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
80       ],
81       'sources': [
82         'common/url_type_converters.cc',
83         'common/url_type_converters.h',
84       ],
85     },
86     {
87       # GN version: //mojo/converters/geometry
88       'target_name': 'mojo_geometry_lib',
89       'type': '<(component)',
90       'defines': [
91         'MOJO_GEOMETRY_IMPLEMENTATION',
92       ],
93       'dependencies': [
94         '../ui/mojo/geometry/mojo_bindings.gyp:mojo_geometry_bindings',
95         '../ui/gfx/gfx.gyp:gfx_geometry',
96         'mojo_environment_chromium',
97         '<(mojo_system_for_component)',
98       ],
99       'sources': [
100         'converters/geometry/geometry_type_converters.cc',
101         'converters/geometry/geometry_type_converters.h',
102         'converters/geometry/mojo_geometry_export.h',
103       ],
104     },
105     {
106       # GN version: //mojo/common:mojo_common_unittests
107       'target_name': 'mojo_common_unittests',
108       'type': 'executable',
109       'dependencies': [
110         '../base/base.gyp:base',
111         '../base/base.gyp:test_support_base',
112         '../base/base.gyp:base_message_loop_tests',
113         '../testing/gtest.gyp:gtest',
114         '../url/url.gyp:url_lib',
115         'mojo_common_lib',
116         'mojo_url_type_converters',
117         '../third_party/mojo/mojo_edk.gyp:mojo_system_impl',
118         '../third_party/mojo/mojo_edk.gyp:mojo_common_test_support',
119         '../third_party/mojo/mojo_edk.gyp:mojo_run_all_unittests',
120         'mojo_environment_chromium',
121         '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
122         '../third_party/mojo/mojo_public.gyp:mojo_public_test_utils',
123       ],
124       'sources': [
125         'common/common_type_converters_unittest.cc',
126         'common/handle_watcher_unittest.cc',
127         'common/message_pump_mojo_unittest.cc',
128       ],
129     },
130     {
131       # GN version: //mojo/environment:chromium
132       'target_name': 'mojo_environment_chromium',
133       'type': 'static_library',
134       'dependencies': [
135         'mojo_environment_chromium_impl',
136         '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
137       ],
138       'sources': [
139         'environment/environment.cc',
140         # TODO(vtl): This is kind of ugly. (See TODO in logging.h.)
141         "../third_party/mojo/src/mojo/public/cpp/environment/async_waiter.h",
142         "../third_party/mojo/src/mojo/public/cpp/environment/lib/async_waiter.cc",
143         "../third_party/mojo/src/mojo/public/cpp/environment/lib/logging.cc",
144         "../third_party/mojo/src/mojo/public/cpp/environment/lib/scoped_task_tracking.cc",
145         "../third_party/mojo/src/mojo/public/cpp/environment/lib/scoped_task_tracking.cc",
146         "../third_party/mojo/src/mojo/public/cpp/environment/logging.h",
147         "../third_party/mojo/src/mojo/public/cpp/environment/task_tracker.h",
148       ],
149       'include_dirs': [
150         '..',
151         '../third_party/mojo/src',
152       ],
153       'direct_dependent_settings': {
154         'include_dirs': [
155           '../third_party/mojo/src',
156         ],
157       },
158       'export_dependent_settings': [
159         'mojo_environment_chromium_impl',
160       ],
161     },
162     {
163       # GN version: //mojo/environment:chromium_impl
164       'target_name': 'mojo_environment_chromium_impl',
165       'type': '<(component)',
166       'defines': [
167         'MOJO_ENVIRONMENT_IMPL_IMPLEMENTATION',
168       ],
169       'dependencies': [
170         '../base/base.gyp:base',
171         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
172         'mojo_common_lib',
173         '<(mojo_system_for_component)',
174       ],
175       'sources': [
176         'environment/default_async_waiter_impl.cc',
177         'environment/default_async_waiter_impl.h',
178         'environment/default_logger_impl.cc',
179         'environment/default_logger_impl.h',
180         'environment/default_run_loop_impl.cc',
181         'environment/default_run_loop_impl.h',
182         'environment/default_task_tracker_impl.cc',
183         'environment/default_task_tracker_impl.h',
184       ],
185       'include_dirs': [
186         '..',
187         '../third_party/mojo/src',
188       ],
189       'direct_dependent_settings': {
190         'include_dirs': [
191           '../third_party/mojo/src',
192         ],
193       },
194     },
195     {
196       'target_name': 'mojo_application_bindings_mojom',
197       'type': 'none',
198       'variables': {
199         'mojom_files': [
200           'application/public/interfaces/application.mojom',
201           'application/public/interfaces/content_handler.mojom',
202           'application/public/interfaces/service_provider.mojom',
203           'application/public/interfaces/shell.mojom',
204         ],
205       },
206       'dependencies': [
207         'mojo_services.gyp:network_service_bindings_generation',
208       ],
209       'export_dependent_settings': [
210         'mojo_services.gyp:network_service_bindings_generation',
211       ],
212       'includes': [ '../third_party/mojo/mojom_bindings_generator_explicit.gypi' ],
213     },
214     {
215       # GN version: //mojo/application/public/cpp
216       'target_name': 'mojo_application_base',
217       'type': 'static_library',
218       'sources': [
219         'application/public/cpp/app_lifetime_helper.h',
220         'application/public/cpp/application_connection.h',
221         'application/public/cpp/application_delegate.h',
222         'application/public/cpp/application_impl.h',
223         'application/public/cpp/application_runner.h',
224         'application/public/cpp/connect.h',
225         'application/public/cpp/interface_factory.h',
226         'application/public/cpp/interface_factory_impl.h',
227         'application/public/cpp/lib/app_lifetime_helper.cc',
228         'application/public/cpp/lib/application_connection.cc',
229         'application/public/cpp/lib/application_delegate.cc',
230         'application/public/cpp/lib/application_impl.cc',
231         'application/public/cpp/lib/application_runner.cc',
232         'application/public/cpp/lib/interface_factory_connector.h',
233         'application/public/cpp/lib/service_connector_registry.cc',
234         'application/public/cpp/lib/service_connector_registry.h',
235         'application/public/cpp/lib/service_provider_impl.cc',
236         'application/public/cpp/lib/service_registry.cc',
237         'application/public/cpp/lib/service_registry.h',
238         'application/public/cpp/service_connector.h',
239         'application/public/cpp/service_provider_impl.h',
240       ],
241       'dependencies': [
242         'mojo_application_bindings',
243         'mojo_common_lib',
244       ],
245     },
246     {
247       # GN version: //mojo/public/interfaces/application:application
248       'target_name': 'mojo_application_bindings',
249       'type': 'static_library',
250       'dependencies': [
251         'mojo_application_bindings_mojom',
252         'mojo_services.gyp:network_service_bindings_lib',
253         '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings',
254       ],
255       'export_dependent_settings': [
256         'mojo_services.gyp:network_service_bindings_lib',
257       ],
258     },
259     {
260       # GN version: //mojo/test:test_support
261       'target_name': 'mojo_test_support',
262       'type': 'static_library',
263       'dependencies': [
264         '../base/base.gyp:base',
265       ],
266       'sources': [
267         'test/test_utils.h',
268         'test/test_utils_posix.cc',
269         'test/test_utils_win.cc',
270       ],
271     },
272     {
273       # GN version: //mojo/application/public/cpp/tests
274       'target_name': 'mojo_public_application_unittests',
275       'type': 'executable',
276       'dependencies': [
277         'mojo_application_base',
278         '../base/base.gyp:base',
279         '../testing/gtest.gyp:gtest',
280         '../third_party/mojo/mojo_edk.gyp:mojo_run_all_unittests',
281         '../third_party/mojo/mojo_public.gyp:mojo_utility',
282         '../third_party/mojo/mojo_public.gyp:mojo_environment_standalone',
283       ],
284       'sources': [
285         'application/public/cpp/tests/service_registry_unittest.cc',
286       ],
287     },
288   ],
289   'conditions': [
290     ['OS=="android"', {
291       'targets': [
292         {
293           'target_name': 'mojo_jni_headers',
294           'type': 'none',
295           'dependencies': [
296             'mojo_java_set_jni_headers',
297           ],
298           'sources': [
299             'android/javatests/src/org/chromium/mojo/MojoTestCase.java',
300             'android/javatests/src/org/chromium/mojo/bindings/ValidationTestUtil.java',
301             'android/system/src/org/chromium/mojo/system/impl/CoreImpl.java',
302           ],
303           'variables': {
304             'jni_gen_package': 'mojo',
305           },
306           'includes': [ '../build/jni_generator.gypi' ],
307         },
308         {
309           'target_name': 'libmojo_system_java',
310           'type': 'static_library',
311           'dependencies': [
312             '../base/base.gyp:base',
313             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
314             'mojo_common_lib',
315             '../third_party/mojo/mojo_edk.gyp:mojo_system_impl',
316             'mojo_environment_chromium',
317             'mojo_jni_headers',
318           ],
319           'sources': [
320             'android/system/core_impl.cc',
321             'android/system/core_impl.h',
322           ],
323         },
324         {
325           'target_name': 'mojo_java_set_jni_headers',
326           'type': 'none',
327           'variables': {
328             'jni_gen_package': 'mojo',
329             'input_java_class': 'java/util/HashSet.class',
330           },
331           'includes': [ '../build/jar_file_jni_generator.gypi' ],
332         },
333         {
334           'target_name': 'mojo_system_java',
335           'type': 'none',
336           'dependencies': [
337             '../base/base.gyp:base_java',
338             'libmojo_system_java',
339             '../third_party/mojo/mojo_public.gyp:mojo_public_java',
340           ],
341           'variables': {
342             'java_in_dir': '<(DEPTH)/mojo/android/system',
343           },
344           'includes': [ '../build/java.gypi' ],
345         },
346       ],
347     }],
348     ['test_isolation_mode != "noop"', {
349       'targets': [
350         {
351           'target_name': 'mojo_common_unittests_run',
352           'type': 'none',
353           'dependencies': [
354             'mojo_common_unittests',
355           ],
356           'includes': [
357             '../build/isolate.gypi',
358           ],
359           'sources': [
360             'mojo_common_unittests.isolate',
361           ],
362         },
363       ],
364     }],
365   ]