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 <oswald.buddenhagen@digia.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
This commit is contained in:
Adam Strzelecki 2014-08-07 13:06:55 +02:00 committed by Oswald Buddenhagen
parent 8f22f242a2
commit dbb0d54699

View File

@ -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")) {