Merge remote-tracking branch 'origin/master' into 1.8

This commit is contained in:
Wojtek Figat
2023-12-08 11:23:06 +01:00
155 changed files with 4997 additions and 2971 deletions

View File

@@ -247,7 +247,7 @@ namespace Flax.Build
args.Add("/fullpaths");
args.Add("/filealign:512");
#if USE_NETCORE
args.Add("/langversion:11.0");
args.Add($"/langversion:{dotnetSdk.CSharpLanguageVersion}");
args.Add(string.Format("/nullable:{0}", buildOptions.ScriptingAPI.CSharpNullableReferences.ToString().ToLowerInvariant()));
if (buildOptions.ScriptingAPI.CSharpNullableReferences == CSharpNullableReferences.Disable)
args.Add("-nowarn:8632"); // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

View File

@@ -161,6 +161,18 @@ namespace Flax.Build
/// </summary>
public readonly string RuntimeVersionName;
/// <summary>
/// Maximum supported C#-language version for the SDK.
/// </summary>
public string CSharpLanguageVersion => Version.Major switch
{
8 => "12.0",
7 => "11.0",
6 => "10.0",
5 => "9.0",
_ => "7.3",
};
/// <summary>
/// Initializes a new instance of the <see cref="DotNetSdk"/> class.
/// </summary>