summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt_functions.prf
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-02-01 17:30:31 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-04 15:10:22 +0100
commit4c34b418b89681d1228ab24749f4462bf0054d56 (patch)
tree818801a2f17bf899a108525134bee77afc033520 /mkspecs/features/qt_functions.prf
parent87054805872429c1c17135f9ae5364b050d3fdff (diff)
fix lack of rpath-link when using modules from final location
if the libraries are in a non-standard location, but no rpath is used, rpath-link is needed. this is often the case for non-prefix builds (which have no forwarding pris any more). as we cannot store absolute paths in the final pris, we need to store the module names, and resolve them only at use time. Change-Id: I1538b5d531611c76a2d7058a3b2ff683bdcbe427 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'mkspecs/features/qt_functions.prf')
-rw-r--r--mkspecs/features/qt_functions.prf27
1 files changed, 18 insertions, 9 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 389f2418ad..6fca19af57 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -121,15 +121,6 @@ defineTest(qtAddModule) {
contains(MODULE_CONFIG, staticlib): \
PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
-
- # Make sure we can link to uninstalled libraries
- !isEmpty(MODULE_LIBS) {
- for(rpl, QT.$${1}.rpath_link): \
- QMAKE_RPATHLINKDIR *= $$rpl
- !auto_use_privates:!isEqual(2, UsePrivate): \
- for(rpl, QT.$${1}.rpath_link_private): \
- QMAKE_RPATHLINKDIR *= $$rpl
- }
}
# Only link to this module if a libs directory is set, else this is just a module
# to give access to sources or include files, and not for linking.
@@ -190,6 +181,24 @@ defineTest(qtAddModules) {
export(using_privates)
}
+defineTest(qtAddRpathLink) {
+ # -rpath-link is used by the linker to find dependencies of dynamic
+ # libraries which were NOT specified on the command line.
+ # This means that paths of direct dependencies (QT & QT_PRIVATE)
+ # don't need to appear here. However, their private dependencies'
+ # paths OTOH need to be put there.
+ pubqt = $$replace(1, -private$, )
+ pubdep = $$resolve_depends(pubqt, "QT.")
+ privdep = $$resolve_depends(pubqt, "QT.", ".depends" ".private_depends" ".run_depends")
+ privdep -= $$pubdep
+ rpaths =
+ for(dep, privdep): \
+ rpaths += $$eval(QT.$${dep}.libs)
+ QMAKE_RPATHLINKDIR *= $$unique(rpaths)
+ QMAKE_RPATHLINKDIR -= $$QMAKE_RPATHDIR # -rpath implies -rpath-link
+ export(QMAKE_RPATHLINKDIR)
+}
+
# variable, default
defineTest(qtPrepareTool) {
$$1 = $$eval(QT_TOOL.$${2}.command)