summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-06-23 20:12:03 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-10-01 16:19:08 +0000
commite88334e013412780daf06fd813896483bbc0991e (patch)
tree58f8edaa4bf625a5edf3cb3ef7a2495a461e4284 /qmake
parent8e3e0897634a7c0531c789a5598b7fb3070eb306 (diff)
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>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/win32/winmakefile.cpp13
1 files 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"))