Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.14.0
-
None
-
VS2019
-
-
1f8ced2d6df024ba007f9bb25e12bf4e23aee2db (qt/qtbase/5.14)
Description
Latest change in `msbuild_objectmodel.cpp` caused that projects in Visual Studio 2019 projects are always recompiled.
The reason is in this line
return commands.join('\n');
in method
commandLinesForOutput()
This will produce invalid content of stdafx.h.cpp for VS2019 which causes that VS2019 to always recompile the whole project.
Based on the previous version of `vcxCommandSeparator`
static QString vcxCommandSeparator() { // MSBuild puts the contents of the custom commands into a batch file and calls it. // As we want every sub-command to be error-checked (as is done by makefile-based // backends), we insert the checks ourselves, using the undocumented jump target. static QString cmdSep = QLatin1String("
if errorlevel 1 goto VCEnd
"); return cmdSep; }
the correct version should look like this:
static QString commandLinesForOutput(QStringList commands) { // MSBuild puts the contents of the custom commands into a batch file and calls it. // As we want every sub-command to be error-checked (as is done by makefile-based // backends), we insert the checks ourselves, using the undocumented jump target. static QString errchk = QStringLiteral("if errorlevel 1 goto VCEnd"); for (int i = commands.count() - 2; i >= 0; --i) { if (!commands.at(i).startsWith("rem", Qt::CaseInsensitive)) commands.insert(i + 1, errchk); } return commands.join("
"); }
After updating qmake to this form, everything works fine.