Progress on dotnet7 runtime hosting with mono

This commit is contained in:
Wojtek Figat
2023-03-22 17:59:46 +01:00
parent 4c4a559125
commit eed2cdfe04
44 changed files with 462 additions and 111 deletions

View File

@@ -62,7 +62,20 @@ namespace Flax.Build
// Add include paths for this project sources and engine third-party sources
var depsRoot = options.DepsFolder;
options.CompileEnv.IncludePaths.Add(Path.Combine(Globals.EngineRoot, @"Source\ThirdParty\mono-2.0")); // TODO: let mono module expose it
{
// TODO: rethink how we should expose mono (and dotnet host api) in general
DotNetSdk.Instance.GetHostRuntime(options.Platform.Target, options.Architecture, out var hostRuntime);
if (hostRuntime.Type == DotNetSdk.HostType.Mono)
{
// Use mono headers from the host runtime
options.CompileEnv.IncludePaths.Add(Path.Combine(hostRuntime.Path, "include", "mono-2.0"));
}
else
{
// Use in-built mono headers
options.CompileEnv.IncludePaths.Add(Path.Combine(Globals.EngineRoot, @"Source\ThirdParty\mono-2.0"));
}
}
options.CompileEnv.IncludePaths.Add(Path.Combine(Globals.EngineRoot, @"Source\ThirdParty"));
options.LinkEnv.LibraryPaths.Add(depsRoot);