Fixes linking issue with angelscript
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
36b39ba3c4
commit
0486c9cdfb
Binary file not shown.
Binary file not shown.
|
@ -21,6 +21,12 @@ namespace PkmnLibSharpTests
|
|||
{
|
||||
NativeLibrary.SetDllImportResolver(assembly, ImportResolver);
|
||||
}
|
||||
|
||||
LoadLibrary("libArbutils");
|
||||
LoadLibrary("libCreatureLib");
|
||||
LoadLibrary("libangelscript");
|
||||
LoadLibrary("libpkmnLib");
|
||||
LoadLibrary("libpkmnlib_ai");
|
||||
|
||||
LogHandler.RegisterListener((level, s) =>
|
||||
{
|
||||
|
@ -31,11 +37,16 @@ namespace PkmnLibSharpTests
|
|||
}
|
||||
|
||||
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 assemblyFile = Environment.OSVersion.Platform == PlatformID.Unix
|
||||
? Path.Join(directory, libraryname + ".so")
|
||||
: Path.Join(directory, libraryname + ".dll");
|
||||
? Path.Join(directory, libraryName + ".so")
|
||||
: Path.Join(directory, libraryName + ".dll");
|
||||
return NativeLibrary.Load(assemblyFile);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue