forked from qt-creator/qt-creator
Simplify RPATHs for qmake build
Use central rpath.pri for setting RPATHs and qttestrpath.pri for tests. Simplify install names of plugins and libraries on macOS to be just @rpath/libName, which follows convention better and makes setting up RPATHs easier. Preparation for moving tools one directory level down on macOS, to be able to add a qt.conf for the tools generically. Task-number: QTCREATORBUG-23120 Change-Id: I16625d48904abd3a7f4c2ad7bbba5916cdc400cd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -12,7 +12,9 @@ win32: VERSION=
|
||||
HEADERS += ../tools/qtcreatorcrashhandler/crashhandlersetup.h
|
||||
SOURCES += main.cpp ../tools/qtcreatorcrashhandler/crashhandlersetup.cpp
|
||||
|
||||
RPATH_BASE = $$IDE_BIN_PATH
|
||||
include(../rpath.pri)
|
||||
|
||||
include(../libs/qt-breakpad/qtbreakpad.pri)
|
||||
|
||||
LIBS *= -l$$qtLibraryName(ExtensionSystem) -l$$qtLibraryName(Aggregation) -l$$qtLibraryName(Utils)
|
||||
|
@@ -13,9 +13,11 @@ win32 {
|
||||
DESTDIR = $$IDE_LIBRARY_PATH
|
||||
|
||||
osx {
|
||||
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/Frameworks/
|
||||
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
|
||||
QMAKE_LFLAGS += -compatibility_version $$QTCREATOR_COMPAT_VERSION
|
||||
}
|
||||
|
||||
RPATH_BASE = $$IDE_LIBRARY_PATH
|
||||
include(rpath.pri)
|
||||
|
||||
TARGET = $$qtLibraryTargetName($$TARGET)
|
||||
|
@@ -85,9 +85,11 @@ exists($$PLUGINJSON_IN) {
|
||||
}
|
||||
|
||||
osx {
|
||||
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/PlugIns/
|
||||
QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
|
||||
QMAKE_LFLAGS += -compatibility_version $$QTCREATOR_COMPAT_VERSION
|
||||
}
|
||||
|
||||
RPATH_BASE = $$IDE_PLUGIN_PATH
|
||||
include(rpath.pri)
|
||||
|
||||
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
|
||||
|
@@ -6,14 +6,8 @@ CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
DESTDIR = $$IDE_LIBEXEC_PATH
|
||||
REL_PATH_TO_LIBS = $$relative_path($$IDE_LIBRARY_PATH, $$IDE_LIBEXEC_PATH)
|
||||
REL_PATH_TO_PLUGINS = $$relative_path($$IDE_PLUGIN_PATH, $$IDE_LIBEXEC_PATH)
|
||||
osx {
|
||||
QMAKE_LFLAGS += -Wl,-rpath,@executable_path/$$REL_PATH_TO_LIBS,-rpath,@executable_path/$$REL_PATH_TO_PLUGINS
|
||||
} else {
|
||||
QMAKE_RPATHDIR += \$\$ORIGIN/$$REL_PATH_TO_LIBS
|
||||
QMAKE_RPATHDIR += \$\$ORIGIN/$$REL_PATH_TO_PLUGINS
|
||||
}
|
||||
|
||||
RPATH_BASE = $$IDE_LIBEXEC_PATH
|
||||
include(rpath.pri)
|
||||
|
||||
target.path = $$INSTALL_LIBEXEC_PATH
|
||||
|
@@ -1,13 +1,19 @@
|
||||
macx {
|
||||
QMAKE_LFLAGS += -Wl,-rpath,@loader_path/../,-rpath,@executable_path/../
|
||||
} else:linux-* {
|
||||
#do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
|
||||
# this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var
|
||||
QMAKE_RPATHDIR += \$\$ORIGIN
|
||||
QMAKE_RPATHDIR += \$\$ORIGIN/..
|
||||
QMAKE_RPATHDIR += \$\$ORIGIN/../$$IDE_LIBRARY_BASENAME/qtcreator
|
||||
IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":")
|
||||
# set RPATH_BASE to the IDE_..._PATH of the target
|
||||
|
||||
isEmpty(RPATH_BASE): \
|
||||
error("You must set RPATH_BASE before including rpath.pri")
|
||||
|
||||
REL_PATH_TO_LIBS = $$relative_path($$IDE_LIBRARY_PATH, $$RPATH_BASE)
|
||||
REL_PATH_TO_PLUGINS = $$relative_path($$IDE_PLUGIN_PATH, $$RPATH_BASE)
|
||||
|
||||
macos {
|
||||
QMAKE_LFLAGS += -Wl,-rpath,@loader_path/$$REL_PATH_TO_LIBS,-rpath,@loader_path/$$REL_PATH_TO_PLUGINS
|
||||
} else:linux-* {
|
||||
QMAKE_RPATHDIR += \$\$ORIGIN
|
||||
QMAKE_RPATHDIR += \$\$ORIGIN/$$REL_PATH_TO_LIBS
|
||||
QMAKE_RPATHDIR += \$\$ORIGIN/$$REL_PATH_TO_PLUGINS
|
||||
|
||||
IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":")
|
||||
QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\'
|
||||
QMAKE_RPATHDIR =
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
QTC_LIB_DEPENDS += cplusplus
|
||||
|
||||
include(../../../qtcreator.pri)
|
||||
|
||||
RPATH_BASE = $$IDE_BIN_PATH
|
||||
include(../../rpath.pri)
|
||||
|
||||
DESTDIR = $$IDE_BIN_PATH
|
||||
|
@@ -19,6 +19,8 @@ include(../../../qtcreator.pri)
|
||||
|
||||
# put into a subdir, so we can deploy a separate qt.conf for it
|
||||
DESTDIR = $$IDE_LIBEXEC_PATH/ios
|
||||
|
||||
RPATH_BASE = $$DESTDIR
|
||||
include(../../rpath.pri)
|
||||
|
||||
SOURCES += main.cpp \
|
||||
|
@@ -7,6 +7,7 @@ include(../../../../qtcreator.pri)
|
||||
osx: DESTDIR = $$IDE_LIBEXEC_PATH/qmldesigner
|
||||
else: DESTDIR = $$IDE_LIBEXEC_PATH
|
||||
|
||||
RPATH_BASE = $$DESTDIR
|
||||
include(../../../rpath.pri)
|
||||
|
||||
include(../../../../share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri)
|
||||
|
@@ -1,5 +1,4 @@
|
||||
QTC_PLUGIN_DEPENDS += cpptools
|
||||
include(../../qttest.pri)
|
||||
include($$IDE_SOURCE_TREE/src/rpath.pri)
|
||||
|
||||
DEFINES += Q_PLUGIN_PATH=\"\\\"$$IDE_PLUGIN_PATH\\\"\"
|
||||
|
@@ -30,9 +30,6 @@ msvc {
|
||||
DEBUGGERDIR = $$IDE_SOURCE_TREE/src/plugins/debugger
|
||||
DUMPERDIR = $$IDE_SOURCE_TREE/share/qtcreator/debugger
|
||||
|
||||
include($$IDE_SOURCE_TREE/src/rpath.pri)
|
||||
|
||||
|
||||
SOURCES += \
|
||||
$$DEBUGGERDIR/debuggerprotocol.cpp \
|
||||
$$DEBUGGERDIR/simplifytype.cpp \
|
||||
|
@@ -1,6 +1,5 @@
|
||||
QTC_LIB_DEPENDS += cplusplus utils extensionsystem
|
||||
include(../../../qttest.pri)
|
||||
include($$IDE_SOURCE_TREE/src/rpath.pri)
|
||||
DEFINES += QMLJS_LIBRARY
|
||||
|
||||
QT += qml xml
|
||||
|
@@ -2,7 +2,6 @@
|
||||
QTC_LIB_DEPENDS += utils
|
||||
include(../../qttest.pri)
|
||||
#DEFINES+=CPLUSPLUS_BUILD_STATIC_LIB
|
||||
include($$IDE_SOURCE_TREE/src/rpath.pri)
|
||||
|
||||
#DEFINES += Q_PLUGIN_PATH=\"\\\"$$IDE_PLUGIN_PATH\\\"\"
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
linux-* {
|
||||
QMAKE_RPATHDIR += $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
|
||||
QMAKE_RPATHDIR += $$IDE_LIBRARY_PATH
|
||||
QMAKE_RPATHDIR += $$IDE_PLUGIN_PATH
|
||||
|
||||
IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":")
|
||||
|
||||
QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\'
|
||||
} else:macx {
|
||||
QMAKE_LFLAGS += -Wl,-rpath,\"$$IDE_BIN_PATH/../\"
|
||||
QMAKE_LFLAGS += -Wl,-rpath,\"$$IDE_LIBRARY_PATH\",-rpath,\"$$IDE_PLUGIN_PATH\"
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user