Index: mojo/mojo.gyp |
diff --git a/mojo/mojo.gyp b/mojo/mojo.gyp |
index 9f51b95969733e4347162409c20ce62f6a8d6ade..e7cd57a2d7c0f33782b2028e403865a34f32a06d 100644 |
--- a/mojo/mojo.gyp |
+++ b/mojo/mojo.gyp |
@@ -16,6 +16,30 @@ |
'variables': { |
'chromium_code': 1, |
'mojo_shell_debug_url%': "", |
+ 'conditions': [ |
+ # |
+ # The following mojo_system-prefixed variables are used to express a |
+ # dependency on the mojo system APIs. |
+ # |
+ # In a component build, everything can link against mojo_system_impl |
+ # because it is built as a shared library. However, in a non-component |
+ # build, mojo_system_impl is linked into an executable (e.g., |
+ # mojo_shell), and must be injected into other shared libraries (i.e., |
+ # Mojo Apps) that need the mojo system API. |
+ # |
+ # When building a component library, add <(mojo_system_for_component) to |
+ # your dependencies section. When building a loadable module (e.g., a |
+ # Mojo App), add <(mojo_system_for_loadable_module) to your dependencies |
+ # section. |
+ # |
+ ['component=="shared_library"', { |
+ 'mojo_system_for_component': "mojo_system_impl", |
+ 'mojo_system_for_loadable_module': "mojo_system_impl", |
+ }, { |
+ 'mojo_system_for_component': "mojo_none", |
+ 'mojo_system_for_loadable_module': "mojo_system", |
+ }], |
+ ], |
}, |
'includes': [ |
'mojo_apps.gypi', |
@@ -104,6 +128,10 @@ |
] |
}, |
{ |
+ 'target_name': 'mojo_none', |
+ 'type': 'none', |
+ }, |
+ { |
'target_name': 'mojo_external_service_bindings', |
'type': 'static_library', |
'sources': [ |
@@ -298,7 +326,7 @@ |
'mojo_gles2', |
'mojo_gles2_bindings', |
'mojo_environment_chromium', |
- 'mojo_system_impl', |
+ '<(mojo_system_for_component)', |
], |
'defines': [ |
'MOJO_GLES2_IMPL_IMPLEMENTATION', |
@@ -334,11 +362,10 @@ |
'dependencies': [ |
'../base/base.gyp:base', |
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', |
- 'mojo_system_impl', |
+ '<(mojo_system_for_component)', |
], |
'export_dependent_settings': [ |
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', |
- 'mojo_system_impl', |
], |
'sources': [ |
'common/common_type_converters.cc', |
@@ -397,7 +424,6 @@ |
'target_name': 'mojo_environment_chromium', |
'type': 'static_library', |
'dependencies': [ |
- 'mojo_common_lib', |
'mojo_environment_chromium_impl', |
], |
'sources': [ |
@@ -423,7 +449,8 @@ |
'dependencies': [ |
'../base/base.gyp:base', |
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', |
- 'mojo_common_lib' |
+ 'mojo_common_lib', |
+ '<(mojo_system_for_component)', |
], |
'sources': [ |
'environment/default_async_waiter_impl.cc', |
@@ -450,7 +477,7 @@ |
'mojo_common_lib', |
'mojo_environment_chromium', |
'mojo_service_provider_bindings', |
- 'mojo_system_impl', |
+ '<(mojo_system_for_component)', |
], |
'sources': [ |
'service_manager/background_service_loader.cc', |
@@ -492,6 +519,7 @@ |
'../net/net.gyp:net', |
'../url/url.gyp:url_lib', |
'mojo_application', |
+ 'mojo_common_lib', |
'mojo_external_service_bindings', |
'mojo_gles2_impl', |
'mojo_native_viewport_service', |