Add support for dotnet7 on macOS

This commit is contained in:
Wojtek Figat
2023-02-19 13:03:12 +01:00
parent 30fa911832
commit c18cefbb0b
4 changed files with 30 additions and 11 deletions

View File

@@ -210,12 +210,27 @@ namespace Flax.Build
break;
}
case TargetPlatform.Mac:
monoRoot = Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Editor", "Mac", "Mono");
monoPath = Path.Combine(monoRoot, "bin", "mono");
cscPath = Path.Combine(monoRoot, "lib", "mono", "4.5", "csc.exe");
referenceAssemblies = Path.Combine(monoRoot, "lib", "mono", "4.5-api");
referenceAnalyzers = "";
{
#if USE_NETCORE
var dotnetSdk = DotNetSdk.Instance;
if (dotnetSdk.IsValid)
{
// Use dotnet
cscPath = @$"{dotnetSdk.RootPath}sdk/{dotnetSdk.VersionName}/Roslyn/bincore/csc.dll";
referenceAssemblies = @$"{dotnetSdk.RootPath}shared/Microsoft.NETCore.App/{dotnetSdk.RuntimeVersionName}/";
referenceAnalyzers = @$"{dotnetSdk.RootPath}packs/Microsoft.NETCore.App.Ref/{dotnetSdk.RuntimeVersionName}/analyzers/dotnet/cs/";
}
else
#endif
{
monoRoot = Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Editor", "Mac", "Mono");
monoPath = Path.Combine(monoRoot, "bin", "mono");
cscPath = Path.Combine(monoRoot, "lib", "mono", "4.5", "csc.exe");
referenceAssemblies = Path.Combine(monoRoot, "lib", "mono", "4.5-api");
referenceAnalyzers = "";
}
break;
}
default: throw new InvalidPlatformException(buildPlatform);
}