Commit 8af12f0c authored by Jocelyn Turcotte's avatar Jocelyn Turcotte Committed by Jani Heikkinen
Browse files

Use a relative install_name for QtWebEngineProcess' dependencies


Until we can rely on Qt using @rpath on OSX, QtWebEngineProcess'
dependencies must either be updated by macdeployqt when creating
an .app bundle, either we must make that path relative at build
time.

Since QtWebEngineProcess.app is always deployed inside
QtWebEngineCore.framework, we can safely assume that the dylib is
always in a parent directory and that QtCore.framework can be found
one directory higher.

The additional dependencies of QtWebEngineCore.framework will be
handled by the dynamic linker when it gets loaded, but this only
works for QtWebEngineProcess when macdeployqt uses @loader_path
instead of @executable_path (then relative to the application which
is in a different directory than QtWebEngineProcess).
This can be forced by passing a non-empty value for its
-executable= command-line argument (e.g
`macdeployqt Browser.app -executable=Browser.app/Contents/MacOS/Browser`)

All this will be much simpler once we got Qt framework builds to use
@rpath instead in a future minor version.

Task-number: QTBUG-41611
Change-Id: Ied46c65a09f7033b622708da6e3d85855f9abf34
Reviewed-by: default avatarAndras Becsi <andras.becsi@digia.com>
Showing with 20 additions and 2 deletions
TARGET = $$QTWEBENGINEPROCESS_NAME TARGET = $$QTWEBENGINEPROCESS_NAME
TEMPLATE = app TEMPLATE = app
QT_PRIVATE += webenginecore
load(qt_build_paths) load(qt_build_paths)
contains(QT_CONFIG, qt_framework) { contains(QT_CONFIG, qt_framework) {
# Deploy the QtWebEngineProcess app bundle into the QtWebEngineCore framework. # Deploy the QtWebEngineProcess app bundle into the QtWebEngineCore framework.
DESTDIR = $$MODULE_BASE_OUTDIR/lib/QtWebEngineCore.framework/Versions/5/Helpers DESTDIR = $$MODULE_BASE_OUTDIR/lib/QtWebEngineCore.framework/Versions/5/Helpers
# FIXME: We can remove those steps in Qt 5.5 once @rpath works
# "QT += webenginecore" would pull all dependencies that we'd also need to update
# with install_name_tool on OSX, but we only need access to the private
# QtWebEngine::processMain. qtAddModule will take care of finding where
# the library is without pulling additional librarie.
QT = core
qtAddModule(webenginecore, LIBS)
CONFIG -= link_prl
QMAKE_POST_LINK = \
"xcrun install_name_tool -change " \
"`xcrun otool -X -L $(TARGET) | grep QtWebEngineCore | cut -d ' ' -f 1` " \
"@executable_path/../../../../QtWebEngineCore " \
"$(TARGET); " \
"xcrun install_name_tool -change " \
"`xcrun otool -X -L $(TARGET) | grep QtCore | cut -d ' ' -f 1` " \
"@executable_path/../../../../../../../QtCore.framework/QtCore " \
"$(TARGET) "
} else { } else {
CONFIG -= app_bundle CONFIG -= app_bundle
DESTDIR = $$MODULE_BASE_OUTDIR/libexec DESTDIR = $$MODULE_BASE_OUTDIR/libexec
QT_PRIVATE += webenginecore
} }
INCLUDEPATH += ../core INCLUDEPATH += ../core
......
Supports Markdown
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