qmake: fix extra compilers in vcxprojs for single config mode
authorJoerg Bornemann <joerg.bornemann@digia.com>
Thu, 6 Dec 2012 14:02:59 +0000 (15:02 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 10 Dec 2012 09:17:17 +0000 (10:17 +0100)
In single config mode extra compilers were not written to Visual
Studio project files, because they were not added to the fake project
object we're using to write a single config project.

Task-number: QTBUG-27505

Change-Id: Ie57b648861573496252f1383dc77e0729e244947
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
qmake/generators/win32/msvc_objectmodel.cpp

index 739e423..0d67fca 100644 (file)
@@ -2408,6 +2408,16 @@ void VCProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool)
     outputFilter(tempProj, xml, "TranslationFiles");
     outputFilter(tempProj, xml, "FormFiles");
     outputFilter(tempProj, xml, "ResourceFiles");
+
+    QSet<QString> extraCompilersInProject;
+    for (int i = 0; i < tool.ExtraCompilersFiles.count(); ++i) {
+        const QString &compilerName = tool.ExtraCompilersFiles.at(i).Name;
+        if (!extraCompilersInProject.contains(compilerName)) {
+            extraCompilersInProject += compilerName;
+            tempProj.ExtraCompilers += compilerName;
+        }
+    }
+
     for (int x = 0; x < tempProj.ExtraCompilers.count(); ++x) {
         outputFilter(tempProj, xml, tempProj.ExtraCompilers.at(x));
     }