fix DLL manifest resource ids for debug builds

The resource id must be 2 for DLLs. This was broken for the
"debug with incremental linking" case.

Task-number: QTBUG-28682
Task-number: QTBUG-28683
Change-Id: Id8c48a1dec30e341de949213c63c1c9b73956dac
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Joerg Bornemann 2012-12-18 11:26:09 +01:00 committed by The Qt Project
parent dc2bfb6f89
commit cdff53cda8

View File

@ -409,6 +409,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
manifest = escapeFilePath(fileFixify(manifest));
}
const QString resourceId = (templateName == "app") ? "1" : "2";
const bool incrementalLinking = project->values("QMAKE_LFLAGS").toQStringList().filter(QRegExp("(/|-)INCREMENTAL:NO")).isEmpty();
if (incrementalLinking) {
// Link a resource that contains the manifest without modifying the exe/dll after linking.
@ -418,7 +419,8 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
QString manifest_bak = escapeFilePath(target + "_manifest.bak");
project->values("QMAKE_CLEAN") << manifest_rc << manifest_res;
t << "\n\techo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "
t << "\n\techo " << resourceId
<< " /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "
<< cQuoted(unescapeFilePath(manifest)) << ">" << manifest_rc;
if (generateManifest) {
@ -441,7 +443,6 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
// directly embed the manifest in the executable after linking
t << "\n\t";
writeLinkCommand(t, extraLFlags);
const QString resourceId = (templateName == "app") ? "1" : "2";
t << "\n\t" << "mt.exe /nologo /manifest " << manifest
<< " /outputresource:$(DESTDIR_TARGET);" << resourceId;
}