Browse Source

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.
Robert Dailey 7 năm trước cách đây
mục cha
commit
b07b1aa416
1 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 5 4
      Source/cmVisualStudio10TargetGenerator.cxx

+ 5 - 4
Source/cmVisualStudio10TargetGenerator.cxx

@@ -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.