Fixes linking issue with angelscript
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
36b39ba3c4
commit
0486c9cdfb
BIN
PkmnLibSharp/Native/Linux/libangelscript.so
(Stored with Git LFS)
Executable file
BIN
PkmnLibSharp/Native/Linux/libangelscript.so
(Stored with Git LFS)
Executable file
Binary file not shown.
Binary file not shown.
@ -22,6 +22,12 @@ namespace PkmnLibSharpTests
|
|||||||
NativeLibrary.SetDllImportResolver(assembly, ImportResolver);
|
NativeLibrary.SetDllImportResolver(assembly, ImportResolver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LoadLibrary("libArbutils");
|
||||||
|
LoadLibrary("libCreatureLib");
|
||||||
|
LoadLibrary("libangelscript");
|
||||||
|
LoadLibrary("libpkmnLib");
|
||||||
|
LoadLibrary("libpkmnlib_ai");
|
||||||
|
|
||||||
LogHandler.RegisterListener((level, s) =>
|
LogHandler.RegisterListener((level, s) =>
|
||||||
{
|
{
|
||||||
Console.WriteLine($"[{level.ToString().ToUpperInvariant()}] {s}");
|
Console.WriteLine($"[{level.ToString().ToUpperInvariant()}] {s}");
|
||||||
@ -31,11 +37,16 @@ namespace PkmnLibSharpTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
private IntPtr ImportResolver(string libraryname, Assembly assembly, DllImportSearchPath? searchpath)
|
private IntPtr ImportResolver(string libraryname, Assembly assembly, DllImportSearchPath? searchpath)
|
||||||
|
{
|
||||||
|
return LoadLibrary(libraryname);
|
||||||
|
}
|
||||||
|
|
||||||
|
private IntPtr LoadLibrary(string libraryName)
|
||||||
{
|
{
|
||||||
var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||||
var assemblyFile = Environment.OSVersion.Platform == PlatformID.Unix
|
var assemblyFile = Environment.OSVersion.Platform == PlatformID.Unix
|
||||||
? Path.Join(directory, libraryname + ".so")
|
? Path.Join(directory, libraryName + ".so")
|
||||||
: Path.Join(directory, libraryname + ".dll");
|
: Path.Join(directory, libraryName + ".dll");
|
||||||
return NativeLibrary.Load(assemblyFile);
|
return NativeLibrary.Load(assemblyFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user