summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-06-02 18:28:33 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-10-01 16:19:38 +0000
commitd1cebb09b68788b660c2691ede61534c5a1673cf (patch)
treee0725ccca2ac5d893f29128050341fbeccae8839 /qmake/generators/win32
parent5df87614e388640a4717ffcfeb478cc57575dd4e (diff)
make /LIBPATH: deduplication code more like in the unix generator
Change-Id: If7e83a46b1a2ad92723a222daffa687d74636858 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r--qmake/generators/win32/winmakefile.cpp31
1 files changed, 13 insertions, 18 deletions
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 2d070e89e2..538ab757bd 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -94,26 +94,25 @@ Win32MakefileGenerator::findLibraries()
for (int i = 0; lflags[i]; i++) {
ProStringList &l = project->values(lflags[i]);
for (ProStringList::Iterator it = l.begin(); it != l.end();) {
- bool remove = false;
QString opt = (*it).toQString();
if(opt.startsWith("/LIBPATH:")) {
QString libpath = opt.mid(9);
- QMakeLocalFileName l(libpath);
- if (!dirs.contains(l)) {
- dirs.append(l);
- (*it) = "/LIBPATH:" + l.real();
- } else {
- remove = true;
+ QMakeLocalFileName lp(libpath);
+ if (dirs.contains(lp)) {
+ it = l.erase(it);
+ continue;
}
+ dirs.append(lp);
+ (*it) = "/LIBPATH:" + lp.real();
} else if(opt.startsWith("-L") || opt.startsWith("/L")) {
QString libpath = Option::fixPathToTargetOS(opt.mid(2), false, false);
- QMakeLocalFileName l(libpath);
- if(!dirs.contains(l)) {
- dirs.append(l);
- (*it) = "/LIBPATH:" + l.real();
- } else {
- remove = true;
+ QMakeLocalFileName lp(libpath);
+ if (dirs.contains(lp)) {
+ it = l.erase(it);
+ continue;
}
+ dirs.append(lp);
+ (*it) = "/LIBPATH:" + lp.real();
} else if(opt.startsWith("-l") || opt.startsWith("/l")) {
QString lib = opt.right(opt.length() - 2), out;
if(!lib.isEmpty()) {
@@ -137,11 +136,7 @@ Win32MakefileGenerator::findLibraries()
out = lib + ".lib";
(*it) = out;
}
- if(remove) {
- it = l.erase(it);
- } else {
- ++it;
- }
+ ++it;
}
}
return true;