mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
22 lines
549 B
C#
22 lines
549 B
C#
using System.Runtime.CompilerServices;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Robust.Client.Interop.RobustNative;
|
|
|
|
|
|
internal static class DllMap
|
|
{
|
|
#pragma warning disable CA2255
|
|
[ModuleInitializer]
|
|
#pragma warning restore CA2255
|
|
public static void Initializer()
|
|
{
|
|
if (Environment.GetEnvironmentVariable("ROBUST_NATIVE_PATH") is not { } nativePath)
|
|
return;
|
|
|
|
NativeLibrary.SetDllImportResolver(
|
|
typeof(DllMap).Assembly,
|
|
(_, _, _) => NativeLibrary.Load(nativePath));
|
|
}
|
|
}
|