make processPrlFile() munge the path less when replacing the target

don't prepend the normalized path to the target name, but replace only
the filename in the original string. this ensures that any variables in
the path are preserved.

Change-Id: I58c2b54b7114bfdbf659e6a6ce3e02c2611900d4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Oswald Buddenhagen 2015-09-18 21:02:37 +02:00
parent 3e73e3552c
commit 3e01f1ad3b

View File

@ -877,7 +877,6 @@ MakefileGenerator::processPrlFile(QString &file)
if(QMakeMetaInfo::libExists(file)) { if(QMakeMetaInfo::libExists(file)) {
try_replace_file = true; try_replace_file = true;
meta_file = file; meta_file = file;
file = "";
} else { } else {
QString tmp = file; QString tmp = file;
int ext = tmp.lastIndexOf('.'); int ext = tmp.lastIndexOf('.');
@ -904,14 +903,14 @@ MakefileGenerator::processPrlFile(QString &file)
foreach (const ProString &def, libinfo.values("QMAKE_PRL_DEFINES")) foreach (const ProString &def, libinfo.values("QMAKE_PRL_DEFINES"))
if (!defs.contains(def) && prl_defs.contains(def)) if (!defs.contains(def) && prl_defs.contains(def))
defs.append(def); defs.append(def);
if(try_replace_file && !libinfo.isEmpty("QMAKE_PRL_TARGET")) { if (try_replace_file) {
QString dir; ProString tgt = libinfo.first("QMAKE_PRL_TARGET");
int slsh = real_meta_file.lastIndexOf('/'); if (!tgt.isEmpty()) {
if(slsh != -1) int off = qMax(file.lastIndexOf('/'), file.lastIndexOf('\\')) + 1;
dir = real_meta_file.left(slsh+1); debug_msg(1, " Replacing library reference %s with %s",
file = libinfo.first("QMAKE_PRL_TARGET").toQString(); file.mid(off).toLatin1().constData(), tgt.toQString().toLatin1().constData());
if(QDir::isRelativePath(file)) file.replace(off, 1000, tgt.toQString());
file.prepend(dir); }
} }
} }
} }