aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-09-20 16:28:37 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2023-09-21 09:09:58 +0000
commit4c3b9ef8ee9200580235e708bfc6794576f9caa4 (patch)
tree37dc9705302c21d439f435beb91dccf7154fa874
parent2bbdf96adf589bc58746918e4fa443a23b79c7bf (diff)
Qt support: Let the user decide whether to use RPATH when linking
Fixes: QBS-1035 Change-Id: Idce0d39423b64c7cf04e1c84dd1a90de7bc4aeda Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r--doc/reference/modules/qt-core-module.qdoc8
-rw-r--r--share/qbs/module-providers/Qt/templates/core.qbs4
2 files changed, 10 insertions, 2 deletions
diff --git a/doc/reference/modules/qt-core-module.qdoc b/doc/reference/modules/qt-core-module.qdoc
index 2211c4be6..6aedf2a69 100644
--- a/doc/reference/modules/qt-core-module.qdoc
+++ b/doc/reference/modules/qt-core-module.qdoc
@@ -510,3 +510,11 @@
\defaultvalue \c{versionParts[2]}
*/
+
+/*!
+ \qmlproperty bool Qt.core::useRPaths
+
+ Whether to add \l{Qt.core::libPath}{Qt.core.libPath} to \l{cpp::rpaths}{cpp.rpaths}.
+
+ \defaultvalue \c true on Linux, \c false everywhere else.
+*/
diff --git a/share/qbs/module-providers/Qt/templates/core.qbs b/share/qbs/module-providers/Qt/templates/core.qbs
index ca978eae5..214bd65c2 100644
--- a/share/qbs/module-providers/Qt/templates/core.qbs
+++ b/share/qbs/module-providers/Qt/templates/core.qbs
@@ -109,6 +109,7 @@ Module {
property string libFilePathRelease: @libFilePathRelease@
property string libFilePath: qtBuildVariant === "debug"
? libFilePathDebug : libFilePathRelease
+ property bool useRPaths: qbs.targetOS.contains("linux") && !qbs.targetOS.contains("android")
property stringList coreLibPaths: @libraryPaths@
property bool hasLibrary: true
@@ -198,8 +199,7 @@ Module {
return undefined;
return frameworks;
}
- cpp.rpaths: qbs.targetOS.contains('linux') && !qbs.targetOS.contains("android") ? [libPath] :
- undefined
+ cpp.rpaths: useRPaths ? libPath : undefined
cpp.runtimeLibrary: qbs.toolchain.contains("msvc")
? config.contains("static_runtime") ? "static" : "dynamic"
: original