don't support arbitrary flags in LIBS on windows

there should be no flags other than /LIBPATH: in LIBS (and the variables
that end up in it) - these belong into QMAKE_LFLAGS.

while not very important, this change enables the use of drive-relative
paths using unix path separators.

note that on unix, arbitrary flags must be supported in LIBS due to GNU
ld's --push-state and related position-dependent flags (-whole-archive
in particular). luckily, on unix, flags start with a dash, not a slash.

Started-by: Dyami Caliri <dyami@dragonframe.com>
Change-Id: Ie5764f14d34ad13020ca010499594eed8c69a4a1
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
bb10
Oswald Buddenhagen 2015-06-23 20:12:03 +02:00
parent 8e3e089763
commit e88334e013
1 changed files with 5 additions and 8 deletions

View File

@ -98,13 +98,10 @@ Win32MakefileGenerator::findHighestVersion(const QString &d, const QString &stem
ProString Win32MakefileGenerator::fixLibFlag(const ProString &lib)
{
if (lib.startsWith('/')) {
if (lib.startsWith("/LIBPATH:"))
return QLatin1String("/LIBPATH:")
+ escapeFilePath(Option::fixPathToTargetOS(lib.mid(9).toQString(), false));
// This appears to be a user-supplied flag. Assume sufficient quoting.
return lib;
}
if (lib.startsWith("/LIBPATH:"))
return QLatin1String("/LIBPATH:")
+ escapeFilePath(Option::fixPathToTargetOS(lib.mid(9).toQString(), false));
// This must be a fully resolved library path.
return escapeFilePath(Option::fixPathToTargetOS(lib.toQString(), false));
}
@ -218,7 +215,7 @@ Win32MakefileGenerator::processPrlFiles()
QMakeLocalFileName l(opt.mid(libArg.length()));
if (!libdirs.contains(l))
libdirs.append(l);
} else if (!opt.startsWith("/")) {
} else {
if (!processPrlFile(opt) && (QDir::isRelativePath(opt) || opt.startsWith("-l"))) {
QString tmp;
if (opt.startsWith("-l"))