diff options
author | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-25 20:00:32 +0000 |
---|---|---|
committer | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-25 20:00:32 +0000 |
commit | 28878af02e5276badc12ae8508daf201c53ad7b6 (patch) | |
tree | da1a8a939c64b8536a69e7cfe9e3756e456722a5 /o3d/plugin | |
parent | 15d278058d3c327b401916b96e202c4017fd55e9 (diff) | |
download | chromium_src-28878af02e5276badc12ae8508daf201c53ad7b6.zip chromium_src-28878af02e5276badc12ae8508daf201c53ad7b6.tar.gz chromium_src-28878af02e5276badc12ae8508daf201c53ad7b6.tar.bz2 |
Add missing frameworks to plugin project.
Adjust a lot of build voodoo to get things set correctly for a mach-o bundled plugin.
Create scripts to install private frameworks and modify the plugin to use the private copies.
Review URL: http://codereview.chromium.org/173329
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24291 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin')
-rwxr-xr-x | o3d/plugin/mac/plugin_copy_frameworks.sh | 12 | ||||
-rwxr-xr-x | o3d/plugin/mac/plugin_fix_install_names.sh | 15 | ||||
-rw-r--r-- | o3d/plugin/plugin.gyp | 38 |
3 files changed, 64 insertions, 1 deletions
diff --git a/o3d/plugin/mac/plugin_copy_frameworks.sh b/o3d/plugin/mac/plugin_copy_frameworks.sh new file mode 100755 index 0000000..9edb962 --- /dev/null +++ b/o3d/plugin/mac/plugin_copy_frameworks.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Copy stripped frameworks inside the plugin. + +ditto --arch i386 \ + "${PROJECT_DIR}/../../breakpad/src/client/mac/build/Release/Breakpad.framework" \ + "${BUILT_PRODUCTS_DIR}/O3D.plugin/Contents/Frameworks/Breakpad.framework" + +ditto --arch i386 \ + "${PROJECT_DIR}/../../third_party/cg/files/mac/Cg.framework" \ + "${BUILT_PRODUCTS_DIR}/O3D.plugin/Contents/Frameworks/Cg.framework" + diff --git a/o3d/plugin/mac/plugin_fix_install_names.sh b/o3d/plugin/mac/plugin_fix_install_names.sh new file mode 100755 index 0000000..36ec595 --- /dev/null +++ b/o3d/plugin/mac/plugin_fix_install_names.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Make plugin look in its private Frameworks directory for these frameworks. + +# First take care of Breakpad.framework +/usr/bin/install_name_tool -change \ + @executable_path/../Frameworks/Breakpad.framework/Versions/A/Breakpad \ + @loader_path/../Frameworks/Breakpad.framework/Versions/A/Breakpad \ + "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" + +# Cg.framework +/usr/bin/install_name_tool -change \ + @executable_path/../Library/Frameworks/Cg.framework/Cg \ + @loader_path/../Frameworks/Cg.framework/Cg \ + "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" diff --git a/o3d/plugin/plugin.gyp b/o3d/plugin/plugin.gyp index b9e22ab..b5b72bd 100644 --- a/o3d/plugin/plugin.gyp +++ b/o3d/plugin/plugin.gyp @@ -75,6 +75,9 @@ ], ['OS == "mac"', { + 'mac_bundle': 1, + 'product_extension': 'plugin', + 'product_name': 'O3D', 'dependencies': [ '../../breakpad/breakpad.gyp:breakpad', ], @@ -95,6 +98,8 @@ ], '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', @@ -105,6 +110,28 @@ '../../third_party/glew/files/lib/libGLEW.a', ], }, + 'postbuilds': [ + { + 'variables': { + # Define install_name in a variable ending in _path + # so that gyp understands it's a path and performs proper + # relativization during dict merging. + 'install_name_path': 'mac/plugin_fix_install_names.sh', + }, + 'postbuild_name': 'Fix Framework Paths', + 'action': ['<(install_name_path)'], + }, + { + 'variables': { + # Define copy_frameworks in a variable ending in _path + # so that gyp understands it's a path and performs proper + # relativization during dict merging. + 'copy_frameworks_path': 'mac/plugin_copy_frameworks.sh', + }, + 'postbuild_name': 'Copy Frameworks', + 'action': ['<(copy_frameworks_path)'], + }, + ], }, ], ['OS == "win"', @@ -158,7 +185,16 @@ }, { 'variables': { - 'o3d_main_lib_type': 'shared_library', + 'conditions': [ + ['OS == "mac"', + { + 'o3d_main_lib_type': 'loadable_module', + }, + { + 'o3d_main_lib_type': 'dynamic_library', + }, + ], + ], }, }, ], |