From e88334e013412780daf06fd813896483bbc0991e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 23 Jun 2015 20:12:03 +0200 Subject: [PATCH] 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 Change-Id: Ie5764f14d34ad13020ca010499594eed8c69a4a1 Reviewed-by: Joerg Bornemann --- qmake/generators/win32/winmakefile.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 0d761b08a2..8a41bb7c1e 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -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"))