VS: Use newline for empty DebugInformationFormat tags

Previously, code wrote out empty tags for `<DebugInformationFormat>`
like so:

    <DebugInformationFormat></DebugInformationFormat>

This gets corrected by Visual Studio 2017 when saving the solution. The
correction appears as:

    <DebugInformationFormat>
    </DebugInformationFormat>

In the spirit of keeping the XML structure as close to what Visual
Studio expects as possible, a newline is inserted after the opening tag
in the empty case.
This commit is contained in:
Robert Dailey 2018-01-25 16:01:46 -06:00
parent a24dbba348
commit b07b1aa416

View File

@ -2563,11 +2563,12 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
}
// If not in debug mode, write the DebugInformationFormat field
// without value so PDBs don't get generated uselessly.
// without value so PDBs don't get generated uselessly. Each tag
// goes on its own line because Visual Studio corrects it this
// way when saving the project after CMake generates it.
if (!clOptions.IsDebug()) {
this->WriteString("<DebugInformationFormat>"
"</DebugInformationFormat>\n",
3);
this->WriteString("<DebugInformationFormat>\n", 3);
this->WriteString("</DebugInformationFormat>\n", 3);
}
// Specify the compiler program database file if configured.