Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ericsink/SQLitePCL.raw
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsink committed Nov 7, 2023
2 parents 7d1564a + a2f5bd6 commit 6f4b3ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/batteries_v2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static void Init()
#elif PROVIDER_dynamic

#if PROVIDER_NAME_e_sqlite3
DoDynamic_cdecl("e_sqlite3", NativeLibrary.WHERE_RUNTIME_RID | NativeLibrary.WHERE_ADJACENT);
DoDynamic_cdecl("e_sqlite3", NativeLibrary.WHERE_RUNTIME_RID | NativeLibrary.WHERE_ADJACENT | NativeLibrary.WHERE_CODEBASE);
#elif PROVIDER_NAME_e_sqlcipher
DoDynamic_cdecl("e_sqlcipher", NativeLibrary.WHERE_RUNTIME_RID | NativeLibrary.WHERE_ADJACENT);
#elif PROVIDER_NAME_sqlcipher
Expand Down
1 change: 1 addition & 0 deletions src/common/nativelibrary_defines.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static partial class NativeLibrary
public const int WHERE_RUNTIME_RID = 0x02;
public const int WHERE_ARCH = 0x04;
public const int WHERE_ADJACENT = 0x08;
public const int WHERE_CODEBASE = 0x10;
}
}

8 changes: 8 additions & 0 deletions src/common/nativelibrary_for_netstandard2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,14 @@ LibSuffix suffix
a.Add(Path.Combine(dir, libname));
}

if ((flags & WHERE_CODEBASE) != 0 &&
RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework")
)
{
var dir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
a.Add(new Uri(Path.Combine(dir, libname)).AbsolutePath);
}

return a;
}

Expand Down

0 comments on commit 6f4b3ec

Please sign in to comment.