瀏覽代碼

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 年之前
父節點
當前提交
b07b1aa416
共有 1 個文件被更改,包括 5 次插入4 次删除
  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.