Skip to content

Commit

Permalink
feat: support C# 10 (for *.Net.Compilers.Toolset v4.0.0 or later)
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Dec 2, 2021
1 parent 856c47d commit fb5ac33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Plugins/CSharpCompilerSettings/CSharpLanguageVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ internal enum CSharpLanguageVersion
CSharp7_3 = 703,
CSharp8 = 800,
CSharp9 = 900,
CSharp10 = 1000,
Preview = int.MaxValue - 1,
Latest = int.MaxValue,
}
Expand Down
2 changes: 2 additions & 0 deletions Plugins/CSharpCompilerSettings/CscSettingsAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public string LanguageVersion
case CSharpLanguageVersion.CSharp7_3: return "7.3";
case CSharpLanguageVersion.CSharp8: return "8.0";
case CSharpLanguageVersion.CSharp9: return "9.0";
case CSharpLanguageVersion.CSharp10: return "10.0";
case CSharpLanguageVersion.Preview: return "preview";
default: return "latest";
}
Expand All @@ -170,6 +171,7 @@ public string GetSymbolModifier(string asmdefPath)
sb.Append(LVersion.CSharp7_3 <= v ? "CSHARP_7_3_OR_NEWER;" : "!CSHARP_7_3_OR_NEWER;");
sb.Append(LVersion.CSharp8 <= v ? "CSHARP_8_OR_NEWER;" : "!CSHARP_8_OR_NEWER;");
sb.Append(LVersion.CSharp9 <= v ? "CSHARP_9_OR_NEWER;" : "!CSHARP_9_OR_NEWER;");
sb.Append(LVersion.CSharp10 <= v ? "CSHARP_10_OR_NEWER;" : "!CSHARP_10_OR_NEWER;");

sb.Append("CUSTOM_COMPILE;");
}
Expand Down

0 comments on commit fb5ac33

Please sign in to comment.