Commit 66d1d784 authored by jamesr's avatar jamesr Committed by Commit bot

Put thunk targets directly into loadable modules in static build

gles2_thunks.cc, gles2_impl_thunks.cc, etc define symbols that should be
exported from loadable modules.  If these files are linked into a static
library and that static library is then linked into a loadable module,
the linker may or may not pull in the object files for the thunks
depending on if any symbols from that object file are referenced by
some other object file in the component.

This puts the thunks into a gypi that can be included directly into a
loadable module so the object files containing the thunks are on the
link line directly and make it into the final library.

R=erg@chromium.org

Review URL: https://codereview.chromium.org/509123003

Cr-Commit-Position: refs/heads/master@{#292315}
parent c1f65d4b
...@@ -375,7 +375,9 @@ ...@@ -375,7 +375,9 @@
'mojo_geometry_lib', 'mojo_geometry_lib',
'mojo_surfaces_bindings', 'mojo_surfaces_bindings',
'mojo_surfaces_lib', 'mojo_surfaces_lib',
'<(mojo_gles2_for_loadable_module)', ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
], ],
'export_dependent_settings': [ 'export_dependent_settings': [
'mojo_surfaces_bindings', 'mojo_surfaces_bindings',
...@@ -479,7 +481,9 @@ ...@@ -479,7 +481,9 @@
'../webkit/common/gpu/webkit_gpu.gyp:webkit_gpu', '../webkit/common/gpu/webkit_gpu.gyp:webkit_gpu',
'mojo_cc_support', 'mojo_cc_support',
'mojo_native_viewport_bindings', 'mojo_native_viewport_bindings',
'<(mojo_gles2_for_loadable_module)', ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
], ],
'sources': [ 'sources': [
'aura/aura_init.cc', 'aura/aura_init.cc',
......
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
'mojo_base.gyp:mojo_gles2_bindings', 'mojo_base.gyp:mojo_gles2_bindings',
'mojo_base.gyp:mojo_js_bindings_lib', 'mojo_base.gyp:mojo_js_bindings_lib',
'mojo_native_viewport_bindings', 'mojo_native_viewport_bindings',
'<(mojo_gles2_for_loadable_module)', ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
], ],
'export_dependent_settings': [ 'export_dependent_settings': [
'../base/base.gyp:base', '../base/base.gyp:base',
...@@ -28,7 +30,6 @@ ...@@ -28,7 +30,6 @@
'mojo_base.gyp:mojo_common_lib', 'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_gles2_bindings', 'mojo_base.gyp:mojo_gles2_bindings',
'mojo_native_viewport_bindings', 'mojo_native_viewport_bindings',
'<(mojo_gles2_for_loadable_module)',
], ],
'sources': [ 'sources': [
'apps/js/mojo_runner_delegate.cc', 'apps/js/mojo_runner_delegate.cc',
......
...@@ -74,9 +74,11 @@ ...@@ -74,9 +74,11 @@
'mojo_geometry_bindings', 'mojo_geometry_bindings',
'mojo_gpu_bindings', 'mojo_gpu_bindings',
'mojo_native_viewport_bindings', 'mojo_native_viewport_bindings',
'<(mojo_gles2_for_loadable_module)',
'<(mojo_system_for_loadable_module)', '<(mojo_system_for_loadable_module)',
], ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'sources': [ 'sources': [
'examples/sample_app/gles2_client_impl.cc', 'examples/sample_app/gles2_client_impl.cc',
'examples/sample_app/gles2_client_impl.cc', 'examples/sample_app/gles2_client_impl.cc',
...@@ -164,9 +166,11 @@ ...@@ -164,9 +166,11 @@
'mojo_geometry_lib', 'mojo_geometry_lib',
'mojo_gpu_bindings', 'mojo_gpu_bindings',
'mojo_native_viewport_bindings', 'mojo_native_viewport_bindings',
'<(mojo_gles2_for_loadable_module)',
'<(mojo_system_for_loadable_module)', '<(mojo_system_for_loadable_module)',
], ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'sources': [ 'sources': [
'examples/compositor_app/compositor_app.cc', 'examples/compositor_app/compositor_app.cc',
'examples/compositor_app/compositor_host.cc', 'examples/compositor_app/compositor_host.cc',
...@@ -265,9 +269,11 @@ ...@@ -265,9 +269,11 @@
'mojo_geometry_bindings', 'mojo_geometry_bindings',
'mojo_gpu_bindings', 'mojo_gpu_bindings',
'mojo_native_viewport_bindings', 'mojo_native_viewport_bindings',
'<(mojo_gles2_for_loadable_module)',
'<(mojo_system_for_loadable_module)', '<(mojo_system_for_loadable_module)',
], ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'defines': [ 'defines': [
# We don't really want to export. We could change how # We don't really want to export. We could change how
# ppapi_{shared,thunk}_export.h are defined to avoid this. # ppapi_{shared,thunk}_export.h are defined to avoid this.
...@@ -442,9 +448,11 @@ ...@@ -442,9 +448,11 @@
'mojo_surfaces_app_bindings', 'mojo_surfaces_app_bindings',
'mojo_surfaces_bindings', 'mojo_surfaces_bindings',
'mojo_surfaces_lib', 'mojo_surfaces_lib',
'<(mojo_gles2_for_loadable_module)',
'<(mojo_system_for_loadable_module)', '<(mojo_system_for_loadable_module)',
], ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'sources': [ 'sources': [
'examples/surfaces_app/child_gl_app.cc', 'examples/surfaces_app/child_gl_app.cc',
'examples/surfaces_app/child_gl_impl.cc', 'examples/surfaces_app/child_gl_impl.cc',
...@@ -550,9 +558,11 @@ ...@@ -550,9 +558,11 @@
'mojo_base.gyp:mojo_utility', 'mojo_base.gyp:mojo_utility',
'mojo_geometry_bindings', 'mojo_geometry_bindings',
'mojo_view_manager_bindings', 'mojo_view_manager_bindings',
'<(mojo_gles2_for_loadable_module)',
'<(mojo_system_for_loadable_module)', '<(mojo_system_for_loadable_module)',
], ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'sources': [ 'sources': [
'examples/demo_launcher/demo_launcher.cc', 'examples/demo_launcher/demo_launcher.cc',
], ],
...@@ -652,9 +662,11 @@ ...@@ -652,9 +662,11 @@
'mojo_view_manager_lib', 'mojo_view_manager_lib',
'mojo_views_support', 'mojo_views_support',
'mojo_window_manager_bindings', 'mojo_window_manager_bindings',
'<(mojo_gles2_for_loadable_module)',
'<(mojo_system_for_loadable_module)', '<(mojo_system_for_loadable_module)',
], ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'sources': [ 'sources': [
'examples/window_manager/debug_panel.h', 'examples/window_manager/debug_panel.h',
'examples/window_manager/debug_panel.cc', 'examples/window_manager/debug_panel.cc',
...@@ -676,9 +688,11 @@ ...@@ -676,9 +688,11 @@
'mojo_navigation_bindings', 'mojo_navigation_bindings',
'mojo_view_manager_lib', 'mojo_view_manager_lib',
'mojo_window_manager_bindings', 'mojo_window_manager_bindings',
'<(mojo_gles2_for_loadable_module)',
'<(mojo_system_for_loadable_module)', '<(mojo_system_for_loadable_module)',
], ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'sources': [ 'sources': [
'examples/embedded_app/embedded_app.cc', 'examples/embedded_app/embedded_app.cc',
], ],
...@@ -698,9 +712,11 @@ ...@@ -698,9 +712,11 @@
'mojo_navigation_bindings', 'mojo_navigation_bindings',
'mojo_view_manager_lib', 'mojo_view_manager_lib',
'mojo_window_manager_bindings', 'mojo_window_manager_bindings',
'<(mojo_gles2_for_loadable_module)',
'<(mojo_system_for_loadable_module)', '<(mojo_system_for_loadable_module)',
], ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'sources': [ 'sources': [
'examples/nesting_app/nesting_app.cc', 'examples/nesting_app/nesting_app.cc',
], ],
......
...@@ -43,52 +43,6 @@ ...@@ -43,52 +43,6 @@
'public/platform/native/system_thunks.h', 'public/platform/native/system_thunks.h',
], ],
}, },
{
# GN version: //mojo/public/gles2
'target_name': 'mojo_gles2',
'type': 'static_library',
'defines': [
'MOJO_GLES2_IMPLEMENTATION',
'GLES2_USE_MOJO',
],
'include_dirs': [
'..',
],
'dependencies': [
'../third_party/khronos/khronos.gyp:khronos_headers'
],
'direct_dependent_settings': {
'include_dirs': [
'..',
],
'defines': [
'GLES2_USE_MOJO',
],
},
'all_dependent_settings': {
'conditions': [
# We need to be able to call the MojoSetGLES2Thunks() function in
# gles2_thunks.cc
['OS=="android"', {
'ldflags!': [
'-Wl,--exclude-libs=ALL',
],
}],
],
},
'sources': [
'public/c/gles2/gles2.h',
'public/c/gles2/gles2_export.h',
'public/platform/native/gles2_thunks.cc',
'public/platform/native/gles2_thunks.h',
'public/platform/native/gles2_impl_thunks.cc',
'public/platform/native/gles2_impl_thunks.h',
'public/platform/native/gles2_impl_chromium_texture_mailbox_thunks.cc',
'public/platform/native/gles2_impl_chromium_texture_mailbox_thunks.h',
'public/platform/native/gles2_impl_chromium_sync_point_thunks.cc',
'public/platform/native/gles2_impl_chromium_sync_point_thunks.h',
],
},
{ {
# GN version: //mojo/public/cpp/bindings # GN version: //mojo/public/cpp/bindings
'target_name': 'mojo_cpp_bindings', 'target_name': 'mojo_cpp_bindings',
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# In the non component build, the thunks need to be linked directly into the
# loadable module since they define symbols that should be exported from that
# library. So, this variable expands out to either list the sources directly (in
# the component build where no symbols need to be exported) a dependency.
{
'conditions': [
['component=="shared_library"', {
'dependencies': [
'mojo_base.gyp:mojo_gles2_impl',
],
}, { # component!="shared_library"
'defines': [
'MOJO_GLES2_IMPLEMENTATION',
'GLES2_USE_MOJO',
],
'include_dirs': [
'..',
],
'dependencies': [
'../third_party/khronos/khronos.gyp:khronos_headers'
],
'direct_dependent_settings': {
'include_dirs': [
'..',
],
'defines': [
'GLES2_USE_MOJO',
],
},
'all_dependent_settings': {
'conditions': [
# We need to be able to call the MojoSetGLES2Thunks() function in
# gles2_thunks.cc
['OS=="android"', {
'ldflags!': [
'-Wl,--exclude-libs=ALL',
],
}],
],
},
'sources': [
'public/c/gles2/gles2.h',
'public/c/gles2/gles2_export.h',
'public/platform/native/gles2_thunks.cc',
'public/platform/native/gles2_thunks.h',
'public/platform/native/gles2_impl_thunks.cc',
'public/platform/native/gles2_impl_thunks.h',
'public/platform/native/gles2_impl_chromium_texture_mailbox_thunks.cc',
'public/platform/native/gles2_impl_chromium_texture_mailbox_thunks.h',
'public/platform/native/gles2_impl_chromium_sync_point_thunks.cc',
'public/platform/native/gles2_impl_chromium_sync_point_thunks.h',
],
}]
]
}
...@@ -422,9 +422,11 @@ ...@@ -422,9 +422,11 @@
'mojo_gpu_bindings', 'mojo_gpu_bindings',
'mojo_surfaces_bindings', 'mojo_surfaces_bindings',
'mojo_surfaces_lib', 'mojo_surfaces_lib',
'<(mojo_gles2_for_loadable_module)',
'<(mojo_system_for_loadable_module)', '<(mojo_system_for_loadable_module)',
], ],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'sources': [ 'sources': [
'services/surfaces/surfaces_impl.cc', 'services/surfaces/surfaces_impl.cc',
'services/surfaces/surfaces_impl.h', 'services/surfaces/surfaces_impl.h',
......
...@@ -35,12 +35,10 @@ ...@@ -35,12 +35,10 @@
'mojo_system_for_component': "mojo_base.gyp:mojo_system_impl", 'mojo_system_for_component': "mojo_base.gyp:mojo_system_impl",
'mojo_system_for_loadable_module': "mojo_base.gyp:mojo_system_impl", 'mojo_system_for_loadable_module': "mojo_base.gyp:mojo_system_impl",
'mojo_gles2_for_component': "mojo_base.gyp:mojo_gles2_impl", 'mojo_gles2_for_component': "mojo_base.gyp:mojo_gles2_impl",
'mojo_gles2_for_loadable_module': "mojo_base.gyp:mojo_gles2_impl",
}, { }, {
'mojo_system_for_component': "mojo_base.gyp:mojo_none", 'mojo_system_for_component': "mojo_base.gyp:mojo_none",
'mojo_system_for_loadable_module': "mojo_base.gyp:mojo_system", 'mojo_system_for_loadable_module': "mojo_base.gyp:mojo_system",
'mojo_gles2_for_component': "mojo_base.gyp:mojo_none", 'mojo_gles2_for_component': "mojo_base.gyp:mojo_none",
'mojo_gles2_for_loadable_module': "mojo_base.gyp:mojo_gles2",
}], }],
], ],
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment