summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-11-28 13:21:15 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-30 08:22:35 +0100
commitd31dbe1efe0dd9d2d9d85f9c3c30777c8c5401bf (patch)
tree3dc7fc9e51d9dc6bf1a9956b5d0bd2fa8bd9eaac /qmake
parentd8e6be16033982caab3f50548aa9f19ed0349cb9 (diff)
Remove duplicate libraries added via prl files in Windows
The LIBS statement generated into Makefiles contained duplicate libraries when application was linking static libraries. Fixed by adapting the logic from unixmake.cpp's version of processPrlFiles() to remove duplicates. Change-Id: I12e152900233d0376b7d7ac6cd18a92850a6d640 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/win32/winmakefile.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 8bd45379d6..2fb1fb952b 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -245,6 +245,23 @@ Win32MakefileGenerator::processPrlFiles()
l.insert(lit + prl + 1, prl_libs.at(prl));
prl_libs.clear();
}
+
+ // Merge them into a logical order
+ if (!project->isActiveConfig("no_smart_library_merge") && !project->isActiveConfig("no_lflags_merge")) {
+ ProStringList lflags;
+ for (int lit = 0; lit < l.size(); ++lit) {
+ ProString opt = l.at(lit).trimmed();
+ if (opt.startsWith(libArg)) {
+ if (!lflags.contains(opt))
+ lflags.append(opt);
+ } else {
+ // Make sure we keep the dependency-order of libraries
+ lflags.removeAll(opt);
+ lflags.append(opt);
+ }
+ }
+ l = lflags;
+ }
}
}