From 0b729a9501aa0fbd574b9785570b47bd484f9100 Mon Sep 17 00:00:00 2001
From: Gilles Khouzam <gillesk@microsoft.com>
Date: Wed, 24 Feb 2016 23:32:43 -0800
Subject: [PATCH] Add support for C# 6.0 flag Remove some unnecessary flags and
 fix condition spacing for C# projects

---
 Source/cmVSCSharpFlagTable.h               |  2 ++
 Source/cmVisualStudio10TargetGenerator.cxx | 18 +++++++-----------
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/Source/cmVSCSharpFlagTable.h b/Source/cmVSCSharpFlagTable.h
index ad4ee0e..91237dc 100644
--- a/Source/cmVSCSharpFlagTable.h
+++ b/Source/cmVSCSharpFlagTable.h
@@ -132,6 +132,8 @@ static cmVS7FlagTable cmVSCSharpFlagTable[] =
    "", "4", 0 },
   {"LangVersion", "langversion:5",
    "", "5", 0 },
+  {"LangVersion", "langversion:6",
+   "", "6", 0 },
   {"LangVersion", "langversion:default",
    "", "default", 0 },
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 73ae448..668d716 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -261,7 +261,7 @@ void cmVisualStudio10TargetGenerator::WritePlatformConfigTag(
   stream->width(indentLevel*2 );
   (*stream ) << "";
   (*stream ) << "<" << tag
-             << " Condition=\"'$(Configuration)|$(Platform)'=='";
+             << " Condition=\"'$(Configuration)|$(Platform)' == '";
   (*stream ) << config << "|" << this->Platform << "'\"";
   if(attribute)
     {
@@ -614,7 +614,7 @@ void cmVisualStudio10TargetGenerator::Generate()
     {
     bool first = true;
     for(std::vector<std::string>::const_iterator
-          i = this->Configurations.begin();
+        i = this->Configurations.begin();
         i != this->Configurations.end(); ++i)
       {
       if (first)
@@ -624,7 +624,7 @@ void cmVisualStudio10TargetGenerator::Generate()
         this->WriteString("</PropertyGroup>\n", 1);
         first = false;
         }
-      this->WriteString("<PropertyGroup Condition=\"'$(Configuration)'=='", 1);
+      this->WriteString("<PropertyGroup Condition=\"'$(Configuration)' == '", 1);
       (*this->BuildFileStream) << *i << "'\">\n";
       this->WriteEvents(*i);
       this->WriteString("</PropertyGroup>\n", 1);
@@ -2560,15 +2560,11 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
   if(this->MSTools)
     {
     int exceptionIndent = 3;
-    if (csproj == this->ProjectType)
-      {
-      exceptionIndent = 2;
-      }
-    clOptions.FixExceptionHandlingDefault(exceptionIndent);
-    clOptions.AddFlag("PrecompiledHeader", "NotUsing");
-    std::string asmLocation = configName + "/";
-    if (this->ProjectType != csproj)
+    if (csproj != this->ProjectType)
       {
+      clOptions.FixExceptionHandlingDefault(exceptionIndent);
+      clOptions.AddFlag("PrecompiledHeader", "NotUsing");
+      std::string asmLocation = configName + "/";
       clOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str());
       }
     }
-- 
2.5.1.windows.1

