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>
This commit is contained in:
Miikka Heikkinen 2012-11-28 13:21:15 +02:00 committed by The Qt Project
parent d8e6be1603
commit d31dbe1efe

View File

@ -245,6 +245,23 @@ Win32MakefileGenerator::processPrlFiles()
l.insert(lit + prl + 1, prl_libs.at(prl)); l.insert(lit + prl + 1, prl_libs.at(prl));
prl_libs.clear(); 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;
}
} }
} }