Update README.md

This commit is contained in:
Yoshifumi Kawai 2023-07-02 10:26:11 +09:00 committed by GitHub
parent 134e4f35fa
commit e9071f3bd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,18 +311,22 @@ internal static unsafe partial class NativeMethods
if (libraryName == __DllName)
{
var path = "runtimes/";
var extension = "";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
path += "win-";
extension = ".dll";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
path += "osx-";
extension = ".dylib";
}
else
{
path += "linux-";
extension = ".so";
}
if (RuntimeInformation.OSArchitecture == Architecture.X86)
@ -338,7 +342,7 @@ internal static unsafe partial class NativeMethods
path += "arm64";
}
path += "/native/" + __DllName;
path += "/native/" + __DllName + extension;
return NativeLibrary.Load(Path.Combine(AppContext.BaseDirectory, path), assembly, searchPath);
}