diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-12-01 00:36:06 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-12-08 17:35:00 +0000 |
commit | 5a1bb1db8e10d3964d72d7a15855bd8796d97ec7 (patch) | |
tree | 6aeb792e112af27cb0878875783b6e9139edc316 /src/plugins | |
parent | 06250a36a471a151dfe238d7bbf1b1efbca91aac (diff) |
Rewrite rpath handling for binaries that are a part of Qbs itself
Exporting a list of rpaths from a target is completely bogus as-is,
because a target cannot know a dependee's install location relative to
itself. This patch instead has each target category (executables in bin,
libraries in lib, libexec binaries in libexec/qbs, and plugins in
lib/qbs/plugins) set its relative installation directory at the product
level, and then an appropriate rpath is created for the target by
calculating a relative path from the target to the lib directory in the
context of an installed build. This also has the advantage that rpaths
are now calculated dynamically at build time rather than hardcoded, so
if a user changes the directory depth of pluginsInstallDir, for example,
everything will be adjusted automatically. Each target also therefore
now has an rpath pointing exactly to its immediate dependencies, instead
of relying on the parent process to inherit the rpath entries. Among
simply being correct, this also has the advantage that any target can
now be loaded correctly by another process which itself sets no rpath
happening to point to the qbs lib directory.
Change-Id: I8fdf24b74ef60426cea0930b7941479919226fd2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qbsplugin.qbs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/qbsplugin.qbs b/src/plugins/qbsplugin.qbs index dc1d4d612..a2b4fe8a5 100644 --- a/src/plugins/qbsplugin.qbs +++ b/src/plugins/qbsplugin.qbs @@ -25,9 +25,10 @@ QbsProduct { .concat(qbs.buildVariant === "debug" ? [isForDarwin ? "debuginfo_loadablemodule" : "debuginfo_dll"] : []) qbs.install: true - qbs.installDir: qbsbuildconfig.pluginsInstallDir + "/qbs/plugins" qbs.installSourceBase: destinationDirectory + qbs.installDir: targetInstallDir } + targetInstallDir: qbsbuildconfig.pluginsInstallDir Properties { condition: isForDarwin bundle.isBundle: false |