mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-12-23 08:21:09 +00:00
Add support for linux and macos
This commit is contained in:
parent
9ef634bd4b
commit
0861b6aa4f
4 changed files with 41 additions and 8 deletions
|
|
@ -1,14 +1,23 @@
|
|||
all:
|
||||
echo "make [build|test|benchmark|build-production]"
|
||||
|
||||
build:
|
||||
build-rust:
|
||||
cargo build --target-dir ./rs_compiled/
|
||||
|
||||
build-dotnet:
|
||||
dotnet build ./src/Turso/Turso.csproj
|
||||
|
||||
build-production:
|
||||
build-rust-production:
|
||||
cargo build --release --target-dir ./rs_compiled/
|
||||
|
||||
build-dotnet-production:
|
||||
dotnet build -c Release ./src/Turso/Turso.csproj
|
||||
|
||||
|
||||
build: build-rust build-dotnet
|
||||
|
||||
build-production: build-rust-production build-dotnet-production
|
||||
|
||||
test: build
|
||||
dotnet test ./src/Turso.Tests/Turso.Tests.csproj
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,34 @@
|
|||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
|
||||
<DefineConstants>OS_WINDOWS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
|
||||
<DefineConstants>OS_LINUX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
|
||||
<DefineConstants>OS_MAC</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<None Include="..\..\rs_compiled\debug\*.*" Visible="false">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(Configuration)'=='Release'">
|
||||
<ItemGroup Condition="'$(Configuration)'=='Release' AND Exists('..\..\rs_compiled\release\turso_dotnet.dll')">
|
||||
<None Include="..\..\rs_compiled\release\turso_dotnet.dll" Visible="false">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(Configuration)'=='Release' AND Exists('..\..\rs_compiled\release\turso_dotnet.so')">
|
||||
<None Include="..\..\rs_compiled\release\turso_dotnet.so" Visible="false">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(Configuration)'=='Release' AND Exists('..\..\rs_compiled\release\turso_dotnet.dylib')">
|
||||
<None Include="..\..\rs_compiled\release\turso_dotnet.dylib" Visible="false">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,15 @@ namespace Turso.Raw;
|
|||
|
||||
internal static class TursoInterop
|
||||
{
|
||||
private const string DllName = "turso_dotnet.dll";
|
||||
|
||||
private const string DllName =
|
||||
#if OS_WINDOWS
|
||||
"turso_dotnet.dll";
|
||||
#elif OS_LINUX
|
||||
"turso_dotnet.so";
|
||||
#elif OS_MAC
|
||||
"turso_dotnet.dylib";
|
||||
#endif
|
||||
|
||||
[DllImport(DllName, EntryPoint = "db_open", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr OpenDatabase(string path, out IntPtr errorPtr);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Turso.Raw\Turso.Raw.csproj" />
|
||||
<ProjectReference Include="..\Turso.Raw\Turso.Raw.csproj" />
|
||||
<ProjectReference Include="..\Turso\Turso.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue