handler/mac: Support the in-Chromium component=shared_library

configuration.

When depending on shared libraries such as libbase.dylib,
crashpad_handler must have an LC_RPATH pointing to the
out/{Debug,Release} directory relative to its home deep within
Chromium.app.

BUG=chromium:466964
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1009633002
This commit is contained in:
Mark Mentovai 2015-03-13 18:23:17 -04:00
parent e7b80a52f5
commit 1d022a86db

View File

@ -15,6 +15,7 @@
{ {
'includes': [ 'includes': [
'../build/crashpad.gypi', '../build/crashpad.gypi',
'../build/crashpad_in_chromium.gypi',
], ],
'conditions': [ 'conditions': [
['OS=="mac"', { ['OS=="mac"', {
@ -43,6 +44,28 @@
'mac/exception_handler_server.h', 'mac/exception_handler_server.h',
'mac/main.cc', 'mac/main.cc',
], ],
# In an in-Chromium build with component=shared_library,
# crashpad_handler will depend on shared libraries such as
# libbase.dylib located in out/{Debug,Release} via the @rpath
# mechanism. When crashpad_handler is copied to its home deep inside
# the Chromium app bundle, it needs to have an LC_RPATH command
# pointing back to the directory containing these dependency
# libraries.
'variables': {
'component%': 'static_library',
},
'conditions': [
['crashpad_in_chromium!=0 and component=="shared_library"', {
'xcode_settings': {
'LD_RUNPATH_SEARCH_PATHS': [ # -Wl,-rpath
# Get back from
# Chromium.app/Contents/Versions/V/Framework.framework/Helpers
'@loader_path/../../../../../..',
],
},
}],
],
}, },
], ],
}, { }, {