From dbb0d5469982c57b29a474e6a940cdecbaf948e2 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Thu, 7 Aug 2014 13:06:55 +0200 Subject: qmake: Don't make rpaths starting with @ or $ absolute Defaults qmake behavior is to make all project RPATHDIR paths absolute prior passing them to linker. We need to make an exception for paths starting with @ such as @executable_path (Apple platforms) or $ such as $ORIGIN (Linux). Task-number: QTBUG-31814 Change-Id: Ie9887c0046c5030c4128dda945b491a5d389ba34 Reviewed-by: Oswald Buddenhagen Reviewed-by: Jake Petroules --- qmake/generators/unix/unixmake.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index e426180012..484ce19225 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -171,11 +171,13 @@ UnixMakefileGenerator::init() } ProStringList &qmklibs = project->values("QMAKE_LIBS"); qmklibs = ldadd + qmklibs; - if(!project->isEmpty("QMAKE_RPATHDIR")) { + if (!project->isEmpty("QMAKE_RPATHDIR") && !project->isEmpty("QMAKE_LFLAGS_RPATH")) { const ProStringList &rpathdirs = project->values("QMAKE_RPATHDIR"); - for(int i = 0; i < rpathdirs.size(); ++i) { - if(!project->isEmpty("QMAKE_LFLAGS_RPATH")) - project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + escapeFilePath(QFileInfo(rpathdirs[i].toQString()).absoluteFilePath()); + for (int i = 0; i < rpathdirs.size(); ++i) { + QString rpathdir = rpathdirs[i].toQString(); + if (!rpathdir.startsWith('@') && !rpathdir.startsWith('$')) + rpathdir = QFileInfo(rpathdir).absoluteFilePath(); + project->values("QMAKE_LFLAGS") += var("QMAKE_LFLAGS_RPATH") + escapeFilePath(rpathdir); } } if (!project->isEmpty("QMAKE_RPATHLINKDIR")) { -- cgit v1.2.3