瀏覽代碼

VS: Teach option map IsDebug() method about C# projects

Michael Stürmer 9 年之前
父節點
當前提交
e438693e95
共有 2 個文件被更改,包括 13 次插入2 次删除
  1. 11 1
      Source/cmVisualStudioGeneratorOptions.cxx
  2. 2 1
      Source/cmVisualStudioGeneratorOptions.h

+ 11 - 1
Source/cmVisualStudioGeneratorOptions.cxx

@@ -130,7 +130,17 @@ void cmVisualStudioGeneratorOptions::SetVerboseMakefile(bool verbose)
 
 bool cmVisualStudioGeneratorOptions::IsDebug() const
 {
-  return this->FlagMap.find("DebugInformationFormat") != this->FlagMap.end();
+  if (this->CurrentTool != CSharpCompiler) {
+    return this->FlagMap.find("DebugInformationFormat") != this->FlagMap.end();
+  }
+  std::map<std::string, FlagValue>::const_iterator i =
+    this->FlagMap.find("DebugType");
+  if (i != this->FlagMap.end()) {
+    if (i->second.size() == 1) {
+      return i->second[0] != "none";
+    }
+  }
+  return false;
 }
 
 bool cmVisualStudioGeneratorOptions::IsWinRt() const

+ 2 - 1
Source/cmVisualStudioGeneratorOptions.h

@@ -28,7 +28,8 @@ public:
     ResourceCompiler,
     MasmCompiler,
     Linker,
-    FortranCompiler
+    FortranCompiler,
+    CSharpCompiler
   };
   cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool,
                                  cmVS7FlagTable const* table,