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)
|
||||
return;
|
||||
|
||||
if(isHFile && pchThroughSourceFile) {
|
||||
if (Project->autogenPrecompSource) {
|
||||
useCustomBuildTool = true;
|
||||
QString toFile(Project->precompSource);
|
||||
CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ...";
|
||||
CustomBuildTool.Outputs += toFile;
|
||||
if (isHFile && pchThroughSourceFile && Project->autogenPrecompSource) {
|
||||
useCustomBuildTool = true;
|
||||
QString toFile(Project->precompSource);
|
||||
CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ...";
|
||||
CustomBuildTool.Outputs += toFile;
|
||||
|
||||
QStringList lines;
|
||||
CustomBuildTool.CommandLine +=
|
||||
QStringList lines;
|
||||
CustomBuildTool.CommandLine +=
|
||||
"echo /*-------------------------------------------------------------------- >" + toFile;
|
||||
lines << "* Precompiled header source file used by Visual Studio.NET to generate";
|
||||
lines << "* the .pch file.";
|
||||
lines << "*";
|
||||
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 << "* create the PCH file directly from the header file.";
|
||||
lines << "*";
|
||||
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 << QLatin1String("* generated when creating ")
|
||||
+ (Config->CompilerVersion < NET2010 ? ".vcproj" : ".vcxproj")
|
||||
+ " project files, and is not used for";
|
||||
lines << "* command line compilations by nmake.";
|
||||
lines << "*";
|
||||
lines << "* WARNING: All changes made in this file will be lost.";
|
||||
lines << "--------------------------------------------------------------------*/";
|
||||
lines << "#include \"" + Project->precompHFilename + "\"";
|
||||
for (const QString &line : qAsConst(lines))
|
||||
CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile;
|
||||
}
|
||||
lines << "* Precompiled header source file used by Visual Studio.NET to generate";
|
||||
lines << "* the .pch file.";
|
||||
lines << "*";
|
||||
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 << "* create the PCH file directly from the header file.";
|
||||
lines << "*";
|
||||
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 << QLatin1String("* generated when creating ")
|
||||
+ (Config->CompilerVersion < NET2010 ? ".vcproj" : ".vcxproj")
|
||||
+ " project files, and is not used for";
|
||||
lines << "* command line compilations by nmake.";
|
||||
lines << "*";
|
||||
lines << "* WARNING: All changes made in this file will be lost.";
|
||||
lines << "--------------------------------------------------------------------*/";
|
||||
lines << "#include \"" + Project->precompHFilename + "\"";
|
||||
for (const QString &line : qAsConst(lines))
|
||||
CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user