summaryrefslogtreecommitdiff
path: root/lib/Djup.Native
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Djup.Native')
-rw-r--r--lib/Djup.Native/.gitignore2
-rw-r--r--lib/Djup.Native/Djup.Native.csproj27
-rw-r--r--lib/Djup.Native/LibDjup.cs12
-rw-r--r--lib/Djup.Native/Program.cs2
4 files changed, 43 insertions, 0 deletions
diff --git a/lib/Djup.Native/.gitignore b/lib/Djup.Native/.gitignore
new file mode 100644
index 0000000..c6e49ef
--- /dev/null
+++ b/lib/Djup.Native/.gitignore
@@ -0,0 +1,2 @@
+obj/
+bin/
diff --git a/lib/Djup.Native/Djup.Native.csproj b/lib/Djup.Native/Djup.Native.csproj
new file mode 100644
index 0000000..7184efb
--- /dev/null
+++ b/lib/Djup.Native/Djup.Native.csproj
@@ -0,0 +1,27 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net8.0</TargetFramework>
+ <!--<OutputType>exe</OutputType>-->
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ </PropertyGroup>
+ <ItemGroup Condition=" '$(Configuration)'=='Release' ">
+ <None Include="$(MSBuildThisFileDirectory)../build/runtimes/linux-x64/native/libdjup.so">
+ <TargetPath>runtimes/linux-x64/native/libdjup.so</TargetPath>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <PackagePath>runtimes/linux-x64/native/</PackagePath>
+ <Pack>true</Pack>
+ </None>
+ </ItemGroup>
+ <ItemGroup Condition=" '$(Configuration)'=='Debug' ">
+ <Content Include="$(MSBuildThisFileDirectory)../build/**">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <!-- This fixes import errors (adding another library with native assets) -->
+ <!--<ItemGroup>-->
+ <!-- <PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.1.10" />-->
+ <!--</ItemGroup>-->
+</Project>
diff --git a/lib/Djup.Native/LibDjup.cs b/lib/Djup.Native/LibDjup.cs
new file mode 100644
index 0000000..5e6db83
--- /dev/null
+++ b/lib/Djup.Native/LibDjup.cs
@@ -0,0 +1,12 @@
+using System.Runtime.InteropServices;
+
+namespace Djup.Native;
+
+public static partial class LibDjup
+{
+ const string LibraryName = "djup";
+ const string Prefix = "dp_";
+
+ [LibraryImport(LibraryName, EntryPoint = Prefix + nameof(hello_world))]
+ public static partial void hello_world();
+}
diff --git a/lib/Djup.Native/Program.cs b/lib/Djup.Native/Program.cs
new file mode 100644
index 0000000..2667048
--- /dev/null
+++ b/lib/Djup.Native/Program.cs
@@ -0,0 +1,2 @@
+/*using Djup.Native;*/
+/*LibDjup.hello_world();*/