Files
MIRROR-LX-OriginalRepo/LX-Build/LX-API.cs
2025-05-03 21:48:16 +01:00

30 lines
1.2 KiB
C#

using System;
using System.Runtime.InteropServices;
namespace LX_Build
{
internal partial class LX_API
{
// Imports SetDllDirectory to change where Dlls are imported from //
[LibraryImport("kernel32.dll", EntryPoint = "SetDllDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool SetDllDirectory(string lpPathName);
// Imports the Frontend of the compiler //
[LibraryImport ("Generator.dll", StringMarshalling = StringMarshalling.Custom,
StringMarshallingCustomType = typeof(System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static partial int GenIR(string arg1, string arg2, string? arg3);
// Sets the directory to import the DLLs from //
public static void Init()
{
#if DEBUG
SetDllDirectory("bin\\x64\\Debug");
#else
SetDllDirectory("bin\\x64\\Release");
#endif
}
}
}