summaryrefslogtreecommitdiffstats
path: root/o3d/plugin
diff options
context:
space:
mode:
authorgspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-06 22:51:32 +0000
committergspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-06 22:51:32 +0000
commitabc98c5e56509da6534a658c967b6fe3675106dc (patch)
tree26915beb3a826866b95e3a8f24a98bd5988df9d6 /o3d/plugin
parent58bb34b3fcaa95ba5e6b54e64a06738a0e399aa0 (diff)
downloadchromium_src-abc98c5e56509da6534a658c967b6fe3675106dc.zip
chromium_src-abc98c5e56509da6534a658c967b6fe3675106dc.tar.gz
chromium_src-abc98c5e56509da6534a658c967b6fe3675106dc.tar.bz2
This makes some changes to the o3d tree in preparation
for landing in Chrome. The biggest pieces here are moving some of the third party dependencies back into o3d/third_party because they need to be distinct from the chrome versions of the same packages, and because O3D is the only one using the dependency. (NPAPI in particular). Also the plugin gyp file is now modified so that it can handle being part of both a chrome developer tree and an o3d developer tree (in the latter case, it generates the plugin and installer, in the former it does not) BE AWARE that this change will change the main solution/xcodebuild file from "build/all" to be "build/o3d", but rebuilding from gyp files will NOT remove the old "build/all" one, so you might be tricked into opening the wrong one. Review URL: http://codereview.chromium.org/256081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28169 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin')
-rw-r--r--o3d/plugin/cross/main.h8
-rw-r--r--o3d/plugin/idl/codegen.py2
-rw-r--r--o3d/plugin/idl/idl.gyp21
-rw-r--r--o3d/plugin/plugin.gyp251
-rw-r--r--o3d/plugin/version_info.py2
5 files changed, 225 insertions, 59 deletions
diff --git a/o3d/plugin/cross/main.h b/o3d/plugin/cross/main.h
index 049c688..5d77d59 100644
--- a/o3d/plugin/cross/main.h
+++ b/o3d/plugin/cross/main.h
@@ -55,16 +55,16 @@
#include "third_party/nixysa/static_glue/npapi/common.h"
#include "third_party/nixysa/static_glue/npapi/npn_api.h"
-#if defined(O3D_INTERNAL_PLUGIN)
-#define HANDLE_CRASHES void(0)
-#else // O3D_INTERNAL_PLUGIN
-
#if defined(OS_LINUX)
#define EXPORT_SYMBOL __attribute__((visibility ("default")))
#else
#define EXPORT_SYMBOL
#endif
+#if defined(O3D_INTERNAL_PLUGIN)
+#define HANDLE_CRASHES void(0)
+#else // O3D_INTERNAL_PLUGIN
+
extern ExceptionManager *g_exception_manager;
// BreakpadEnabler is a simple class to keep track of whether or not
diff --git a/o3d/plugin/idl/codegen.py b/o3d/plugin/idl/codegen.py
index 7494c21..d82d7ab 100644
--- a/o3d/plugin/idl/codegen.py
+++ b/o3d/plugin/idl/codegen.py
@@ -22,7 +22,7 @@ import os
script_dir = os.path.join(os.path.dirname(__file__))
third_party = os.path.normpath(
- os.path.join(script_dir, '..', '..', '..', 'third_party'))
+ os.path.join(script_dir, '..', '..', 'third_party'))
pythonpath = os.pathsep.join([os.path.join(third_party, 'gflags', 'python'),
os.path.join(third_party, 'ply')])
diff --git a/o3d/plugin/idl/idl.gyp b/o3d/plugin/idl/idl.gyp
index 7a393ae..1e710c1 100644
--- a/o3d/plugin/idl/idl.gyp
+++ b/o3d/plugin/idl/idl.gyp
@@ -9,7 +9,7 @@
'variables': {
'chromium_code': 0,
'idl_out_path': '<(SHARED_INTERMEDIATE_DIR)/idl_glue',
- 'static_glue_dir': '../../../third_party/nixysa/static_glue/npapi',
+ 'static_glue_dir': '../../../<(nixysadir)/static_glue/npapi',
'idl_files': [
'archive_request.idl',
'bitmap.idl',
@@ -117,6 +117,18 @@
},
'targets': [
{
+ # This target is only used when we're not built as part of Chrome,
+ # since chrome has its own implementation of the NPAPI from webkit.
+ 'target_name': 'o3dNpnApi',
+ 'type': 'static_library',
+ 'include_dirs': [
+ '../../../<(npapidir)/include',
+ ],
+ 'sources': [
+ '<(static_glue_dir)/npn_api.cc',
+ ],
+ },
+ {
'target_name': 'o3dPluginIdl',
'type': 'static_library',
'dependencies': [
@@ -136,14 +148,10 @@
'action_name': 'generate_idl',
'process_outputs_as_sources': 1,
'inputs': [
- '../../../<(nixysadir)/codegen.py',
- 'codegen.py',
'<@(idl_files)',
],
'outputs': [
- # TODO(bradnelson): fix gyp to be able to handle outputs without
- # and extension on linux.
- #'<(idl_out_path)/hash',
+ '<(idl_out_path)/hash',
'<(idl_out_path)/globals_glue.cc',
'<(idl_out_path)/globals_glue.h',
'<!@(python idl_filenames.py \'<(idl_out_path)\' <@(idl_files))',
@@ -165,7 +173,6 @@
'../cross/o3d_glue.cc',
'../cross/o3d_glue.h',
'<(static_glue_dir)/common.cc',
- '<(static_glue_dir)/npn_api.cc',
'<(static_glue_dir)/static_object.cc',
],
},
diff --git a/o3d/plugin/plugin.gyp b/o3d/plugin/plugin.gyp
index 3c0effb..495e8b8 100644
--- a/o3d/plugin/plugin.gyp
+++ b/o3d/plugin/plugin.gyp
@@ -2,9 +2,59 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+# PLEASE NOTE: This file contains the targets for generating the
+# plugin two different ways -- once as a shared library, and once as a
+# static library. The static library is only built if we are inside
+# of a Chrome tree, and it gets built with different defined symbols,
+# and without the packaging code on the Mac. The shared library gets
+# built in an o3d tree, or in a chrome tree when built by an o3d
+# developer (someone who has added the .gclient stanza to include
+# DEPS_chrome). This results in having two targets in this file which
+# are largely identical, but still significantly different.
+#
+# Please be sure and synchronize these two targets so that we can
+# continue to build both the standalone plugin and the Chrome-embedded
+# plugin.
+
{
'variables': {
'chromium_code': 1,
+ 'plugin_sources': [
+ 'cross/async_loading.cc',
+ 'cross/async_loading.h',
+ 'cross/blacklist.cc',
+ 'cross/config.h',
+ 'cross/config_common.cc',
+ 'cross/download_stream.h',
+ 'cross/main.cc',
+ 'cross/main.h',
+ 'cross/main_thread_task_poster.cc',
+ 'cross/main_thread_task_poster.h',
+ 'cross/marshaling_utils.h',
+ 'cross/np_v8_bridge.cc',
+ 'cross/np_v8_bridge.h',
+ 'cross/out_of_memory.cc',
+ 'cross/out_of_memory.h',
+ 'cross/plugin_logging.h',
+ 'cross/plugin_main.h',
+ 'cross/stream_manager.cc',
+ 'cross/stream_manager.h',
+ 'cross/texture_static_glue.cc',
+ ],
+ 'plugin_depends': [
+ '../../<(jpegdir)/libjpeg.gyp:libjpeg',
+ '../../<(pngdir)/libpng.gyp:libpng',
+ '../../<(zlibdir)/zlib.gyp:zlib',
+ '../../base/base.gyp:base',
+ '../../skia/skia.gyp:skia',
+ '../../v8/tools/gyp/v8.gyp:v8',
+ '../core/core.gyp:o3dCore',
+ '../core/core.gyp:o3dCorePlatform',
+ '../import/archive.gyp:o3dArchive',
+ '../utils/utils.gyp:o3dUtils',
+ '../../native_client/src/shared/imc/imc.gyp:google_nacl_imc',
+ 'idl/idl.gyp:o3dPluginIdl',
+ ],
},
'includes': [
'../build/common.gypi',
@@ -24,43 +74,15 @@
},
'targets': [
{
+ # This is the shared library version of the plugin.
'target_name': 'npo3dautoplugin',
- 'type': '<(o3d_main_lib_type)',
+ 'type': 'loadable_module',
'dependencies': [
- '../../<(jpegdir)/libjpeg.gyp:libjpeg',
- '../../<(pngdir)/libpng.gyp:libpng',
- '../../<(zlibdir)/zlib.gyp:zlib',
- '../../base/base.gyp:base',
- '../../skia/skia.gyp:skia',
- '../../v8/tools/gyp/v8.gyp:v8',
- '../core/core.gyp:o3dCore',
- '../core/core.gyp:o3dCorePlatform',
- '../import/archive.gyp:o3dArchive',
- '../utils/utils.gyp:o3dUtils',
- '../../native_client/src/shared/imc/imc.gyp:google_nacl_imc',
- 'idl/idl.gyp:o3dPluginIdl',
+ '<@(plugin_depends)',
+ 'idl/idl.gyp:o3dNpnApi',
],
'sources': [
- 'cross/async_loading.cc',
- 'cross/async_loading.h',
- 'cross/blacklist.cc',
- 'cross/config.h',
- 'cross/config_common.cc',
- 'cross/download_stream.h',
- 'cross/main.cc',
- 'cross/main.h',
- 'cross/main_thread_task_poster.cc',
- 'cross/main_thread_task_poster.h',
- 'cross/marshaling_utils.h',
- 'cross/np_v8_bridge.cc',
- 'cross/np_v8_bridge.h',
- 'cross/out_of_memory.cc',
- 'cross/out_of_memory.h',
- 'cross/plugin_logging.h',
- 'cross/plugin_main.h',
- 'cross/stream_manager.cc',
- 'cross/stream_manager.h',
- 'cross/texture_static_glue.cc',
+ '<@(plugin_sources)',
],
'conditions' : [
['OS != "linux"',
@@ -239,19 +261,156 @@
'conditions': [
['o3d_in_chrome == "True"',
{
- 'variables': {
- 'o3d_main_lib_type': 'static_library',
- },
- 'target_defaults': {
- 'defines': [
- 'O3D_INTERNAL_PLUGIN=1',
- ],
- },
- },
- {
- 'variables': {
- 'o3d_main_lib_type': 'loadable_module',
- },
+ # Only use the "static_library" plugin target if we're
+ # building in a chrome tree, since we don't need it in an O3D
+ # tree.
+ 'targets': [
+ {
+ 'target_name': 'o3dPlugin',
+ 'type': 'static_library',
+ 'dependencies': [
+ '<@(plugin_depends)',
+ ],
+ 'sources': [
+ '<@(plugin_sources)',
+ ],
+ 'defines':['O3D_INTERNAL_PLUGIN=1'],
+ 'conditions' : [
+ ['OS != "linux"',
+ {
+ 'dependencies': [
+ '../statsreport/statsreport.gyp:o3dStatsReport',
+ 'add_version',
+ 'o3dPluginLogging',
+ ],
+ },
+ ],
+ ['renderer == "gl"',
+ {
+ 'dependencies': [
+ '../build/libs.gyp:gl_libs',
+ '../build/libs.gyp:cg_libs',
+ ],
+ },
+ ],
+ ['OS == "mac"',
+ {
+ 'mac_bundle': 1,
+ 'product_extension': 'plugin',
+ 'product_name': 'O3D',
+ 'dependencies': [
+ '../../breakpad/breakpad.gyp:breakpad',
+ ],
+ 'xcode_settings': {
+ 'INFOPLIST_FILE': '<(SHARED_INTERMEDIATE_DIR)/plugin/Info.plist',
+ },
+ 'mac_bundle_resources': [
+ 'mac/Resources/English.lproj',
+ ],
+ 'sources': [
+ 'mac/config_mac.mm',
+ 'mac/main_mac.mm',
+ 'mac/o3d_plugin.r',
+ 'mac/plugin_logging-mac.mm',
+ 'mac/plugin_mac.h',
+ 'mac/plugin_mac.mm',
+ 'mac/graphics_utils_mac.mm',
+ ],
+ 'mac_framework_dirs': [
+ '../../<(cgdir)',
+ ],
+ 'include_dirs': [
+ '../../breakpad/src/client/mac/Framework',
+ ],
+ 'defines': [
+ 'XP_MACOSX=1',
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
+ '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
+ '$(SDKROOT)/System/Library/Frameworks/AGL.framework',
+ '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
+ '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
+ '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
+ '$(SDKROOT)/System/Library/Frameworks/QuickTime.framework',
+ 'libbreakpad.a',
+ 'libbreakpad_utilities.a',
+ '../../third_party/cg/files/mac/Cg.framework',
+ '../../third_party/glew/files/lib/libMacStaticGLEW.a',
+ ],
+ },
+ },
+ ],
+ ['OS == "linux"',
+ {
+ 'sources': [
+ 'linux/main_linux.cc',
+ 'linux/config.cc',
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '-lGL',
+ ],
+ },
+ # On Linux, shared library targets aren't copied to the
+ # product dir automatically. Filed GYP issue #74 to address this.
+ # TODO(gspencer): Remove when issue #74 is resolved.
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)',
+ 'files': [
+ '<(PRODUCT_DIR)/obj/o3d/plugin/<(LIBRARY_PREFIX)<(_target_name)<(SHARED_LIB_SUFFIX)',
+ ],
+ },
+ ],
+ },
+ ],
+ ['OS == "win"',
+ {
+ 'dependencies': [
+ '../breakpad/breakpad.gyp:o3dBreakpad',
+ ],
+ 'sources': [
+ 'win/config.cc',
+ 'win/logger_main.cc',
+ 'win/main_win.cc',
+ 'win/o3dPlugin.def',
+ 'win/o3dPlugin.rc',
+ 'win/plugin_logging-win32.cc',
+ 'win/resource.h',
+ 'win/update_lock.cc',
+ 'win/update_lock.h',
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '-lrpcrt4.lib',
+ ],
+ },
+ },
+ ],
+ ['OS == "win" and renderer == "d3d9"',
+ {
+ 'link_settings': {
+ 'libraries': [
+ '"$(DXSDK_DIR)/Lib/x86/d3dx9.lib"',
+ '-ld3d9.lib',
+ ],
+ },
+ },
+ ],
+ ['OS == "win" and (renderer == "d3d9" or cb_service == "d3d9")',
+ {
+ 'link_settings': {
+ 'libraries': [
+ '"$(DXSDK_DIR)/Lib/x86/DxErr.lib"',
+ ],
+ },
+ },
+ ],
+ ],
+ },
+ ],
},
],
['OS != "linux"',
diff --git a/o3d/plugin/version_info.py b/o3d/plugin/version_info.py
index 5424cf4..cf908ce 100644
--- a/o3d/plugin/version_info.py
+++ b/o3d/plugin/version_info.py
@@ -22,7 +22,7 @@ import sys
script_dir = os.path.join(os.path.dirname(sys.argv[0]))
gflags_dir = os.path.normpath(
- os.path.join(script_dir, '..', '..', 'third_party', 'gflags', 'python'))
+ os.path.join(script_dir, '..', 'third_party', 'gflags', 'python'))
sys.path.append(gflags_dir)
import gflags