Add macOS build for dotnet7

This commit is contained in:
Wojtek Figat
2023-02-19 13:31:57 +01:00
parent b44c7ab32c
commit 2c1409c2a4
6 changed files with 75 additions and 26 deletions

View File

@@ -59,7 +59,13 @@ bool CoreCLR::InitHostfxr(const String& configPath, const String& libraryPath)
const String path(hostfxrPath);
LOG(Info, "Found hostfxr in {0}", path);
// Get API from hostfxr library
void* hostfxr = Platform::LoadLibrary(path.Get());
if (hostfxr == nullptr)
{
LOG(Error, "Failed to setup hostfxr API ({0})", path);
return true;
}
hostfxr_initialize_for_runtime_config = (hostfxr_initialize_for_runtime_config_fn)Platform::GetProcAddress(hostfxr, "hostfxr_initialize_for_runtime_config");
hostfxr_initialize_for_dotnet_command_line = (hostfxr_initialize_for_dotnet_command_line_fn)Platform::GetProcAddress(hostfxr, "hostfxr_initialize_for_dotnet_command_line");
hostfxr_get_runtime_delegate = (hostfxr_get_runtime_delegate_fn)Platform::GetProcAddress(hostfxr, "hostfxr_get_runtime_delegate");
@@ -69,7 +75,7 @@ bool CoreCLR::InitHostfxr(const String& configPath, const String& libraryPath)
hostfxr_run_app = (hostfxr_run_app_fn)Platform::GetProcAddress(hostfxr, "hostfxr_run_app");
if (!hostfxr_get_runtime_delegate || !hostfxr_run_app)
{
LOG(Error, "Failed to setup hostfxr API");
LOG(Error, "Failed to setup hostfxr API ({0})", path);
return true;
}