Simplify VCFilter::modifyPCHstage a bit
Merge two nested if blocks. This reduces the diff size for a subsequent commit. Change-Id: If60938077169fc6686329cc5c30ebc97ada013a1 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
parent
54fc1b5ae6
commit
e5f94f0f05
@ -2227,36 +2227,34 @@ void VCFilter::modifyPCHstage(QString str)
|
|||||||
if(!isCFile && !isHFile && !isCPPFile)
|
if(!isCFile && !isHFile && !isCPPFile)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(isHFile && pchThroughSourceFile) {
|
if (isHFile && pchThroughSourceFile && Project->autogenPrecompSource) {
|
||||||
if (Project->autogenPrecompSource) {
|
useCustomBuildTool = true;
|
||||||
useCustomBuildTool = true;
|
QString toFile(Project->precompSource);
|
||||||
QString toFile(Project->precompSource);
|
CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ...";
|
||||||
CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ...";
|
CustomBuildTool.Outputs += toFile;
|
||||||
CustomBuildTool.Outputs += toFile;
|
|
||||||
|
|
||||||
QStringList lines;
|
QStringList lines;
|
||||||
CustomBuildTool.CommandLine +=
|
CustomBuildTool.CommandLine +=
|
||||||
"echo /*-------------------------------------------------------------------- >" + toFile;
|
"echo /*-------------------------------------------------------------------- >" + toFile;
|
||||||
lines << "* Precompiled header source file used by Visual Studio.NET to generate";
|
lines << "* Precompiled header source file used by Visual Studio.NET to generate";
|
||||||
lines << "* the .pch file.";
|
lines << "* the .pch file.";
|
||||||
lines << "*";
|
lines << "*";
|
||||||
lines << "* Due to issues with the dependencies checker within the IDE, it";
|
lines << "* Due to issues with the dependencies checker within the IDE, it";
|
||||||
lines << "* sometimes fails to recompile the PCH file, if we force the IDE to";
|
lines << "* sometimes fails to recompile the PCH file, if we force the IDE to";
|
||||||
lines << "* create the PCH file directly from the header file.";
|
lines << "* create the PCH file directly from the header file.";
|
||||||
lines << "*";
|
lines << "*";
|
||||||
lines << "* This file is auto-generated by qmake since no PRECOMPILED_SOURCE was";
|
lines << "* This file is auto-generated by qmake since no PRECOMPILED_SOURCE was";
|
||||||
lines << "* specified, and is used as the common stdafx.cpp. The file is only";
|
lines << "* specified, and is used as the common stdafx.cpp. The file is only";
|
||||||
lines << QLatin1String("* generated when creating ")
|
lines << QLatin1String("* generated when creating ")
|
||||||
+ (Config->CompilerVersion < NET2010 ? ".vcproj" : ".vcxproj")
|
+ (Config->CompilerVersion < NET2010 ? ".vcproj" : ".vcxproj")
|
||||||
+ " project files, and is not used for";
|
+ " project files, and is not used for";
|
||||||
lines << "* command line compilations by nmake.";
|
lines << "* command line compilations by nmake.";
|
||||||
lines << "*";
|
lines << "*";
|
||||||
lines << "* WARNING: All changes made in this file will be lost.";
|
lines << "* WARNING: All changes made in this file will be lost.";
|
||||||
lines << "--------------------------------------------------------------------*/";
|
lines << "--------------------------------------------------------------------*/";
|
||||||
lines << "#include \"" + Project->precompHFilename + "\"";
|
lines << "#include \"" + Project->precompHFilename + "\"";
|
||||||
for (const QString &line : qAsConst(lines))
|
for (const QString &line : qAsConst(lines))
|
||||||
CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile;
|
CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile;
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user