fix PRECOMPILED_SOURCE regression in vc(x)projs

Commit af760349 in Qt4 broke the possibility of having a
PRECOMPILED_SOURCE in a different directory than the
PRECOMPILED_HEADER.
Do not write the PrecompiledHeaderThrough value for the
PRECOMPILED_SOURCE, but use the project default.
The msbuild code path needed adjustments to write the
UsePrecompiledHeader value, even if PrecompiledHeaderThrough is
empty.

Task-number: QTBUG-41917
Change-Id: I74e621f6618cf056e3967c99a2215f76c346b9ee
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Joerg Bornemann 2014-10-14 11:47:25 +02:00
parent 1c91ce375e
commit dc612acdc6
2 changed files with 7 additions and 4 deletions

View File

@ -1956,11 +1956,13 @@ bool VCXProjectWriter::outputFileConfig(OutputFilterData *d, XmlOutput &xml, Xml
}
if ( !filter.CompilerTool.PrecompiledHeaderThrough.isEmpty() ) {
xml << tag("PrecompiledHeaderFile")
<< attrTag("Condition", condition)
<< valueTag(filter.CompilerTool.PrecompiledHeaderThrough)
<< tag("PrecompiledHeader")
<< valueTag(filter.CompilerTool.PrecompiledHeaderThrough);
}
if (filter.CompilerTool.UsePrecompiledHeader != pchUnset) {
xml << tag("PrecompiledHeader")
<< attrTag("Condition", condition)
<< valueTag(toString(filter.CompilerTool.UsePrecompiledHeader));
}

View File

@ -2237,7 +2237,8 @@ void VCFilter::modifyPCHstage(QString str)
useCompilerTool = true;
// Setup PCH options
CompilerTool.UsePrecompiledHeader = (isCFile ? pchNone : pchCreateUsingSpecific);
CompilerTool.PrecompiledHeaderThrough = (isCPPFile ? Project->precompHFilename : QString("$(NOINHERIT)"));
if (isCFile)
CompilerTool.PrecompiledHeaderThrough = QLatin1String("$(NOINHERIT)");
CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)");
}