Skip to content

Commit

Permalink
Add build property to use system SQLite (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Partmedia authored Jan 3, 2024
1 parent 8501ac9 commit f09b0fe
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
</PropertyGroup>
<ItemGroup>
<!-- Launcher-loader shared stuff -->
<PackageVersion Include="Microsoft.Data.Sqlite" Version="7.0.4"/>
<PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="7.0.4" />
<PackageVersion Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.4" Condition="'$(UseSystemSqlite)' != 'True'" />
<PackageVersion Include="SQLitePCLRaw.provider.sqlite3" Version="2.1.4" Condition="'$(UseSystemSqlite)' == 'True'" />
<PackageVersion Include="NSec.Cryptography" Version="22.4.0"/>
<PackageVersion Include="SharpZstd.Interop" Version="1.5.2-beta2"/>
<PackageVersion Include="JetBrains.Annotations" Version="2023.2.0-eap3" />
Expand Down
4 changes: 4 additions & 0 deletions SS14.Launcher/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Microsoft.Data.Sqlite;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down Expand Up @@ -42,6 +43,9 @@ public static void Main(string[] args)
Console.OutputEncoding = Encoding.UTF8;
#endif

#if USE_SYSTEM_SQLITE
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3());
#endif
var msgr = new LauncherMessaging();
Locator.CurrentMutable.RegisterConstant(msgr);

Expand Down
10 changes: 9 additions & 1 deletion SS14.Launcher/SS14.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>CA1416</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('FreeBSD'))">
<UseSystemSqlite>True</UseSystemSqlite>
</PropertyGroup>
<PropertyGroup Condition="'$(UseSystemSqlite)' == 'True'">
<DefineConstants>$(DefineConstants);USE_SYSTEM_SQLITE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">
<DependentUpon>%(Filename)</DependentUpon>
Expand Down Expand Up @@ -39,7 +45,9 @@
<PackageReference Include="CodeHollow.FeedReader" />
<PackageReference Include="Dapper" />
<PackageReference Include="DynamicData" />
<PackageReference Include="Microsoft.Data.Sqlite" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" />
<PackageReference Include="SQLitePCLRaw.provider.sqlite3" Condition="'$(UseSystemSqlite)' == 'True'" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Condition="'$(UseSystemSqlite)' != 'True'" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" />
<PackageReference Include="ReactiveUI" />
<PackageReference Include="ReactiveUI.Fody" />
Expand Down
4 changes: 3 additions & 1 deletion SS14.Loader/SS14.Loader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" />
<PackageReference Include="SQLitePCLRaw.provider.sqlite3" Condition="'$(UseSystemSqlite)' == 'True'" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Condition="'$(UseSystemSqlite)' != 'True'" />
<PackageReference Include="NSec.Cryptography" />
<PackageReference Include="Robust.Natives" />
<PackageReference Include="SharpZstd.Interop" />
Expand Down

0 comments on commit f09b0fe

Please sign in to comment.