Generate native bindings from rust crate

This commit is contained in:
2025-06-04 17:09:39 -03:00
parent 738f9c947b
commit 6ab490ce07
37 changed files with 1112 additions and 23 deletions

3
scripts/cbindgen.ps1 Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env sh
cbindgen --config ./config/cbindgen.toml --crate tribufu-sdk --output ./include/tribufu/native.h

10
scripts/unix/premake.sh Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
if [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]
then
./vendor/premake-core/linux/premake5 gmake2
elif [ "$(uname)" = "Darwin" ]
then
./vendor/premake-core/mac/premake5 xcode4
fi

12
scripts/windows/build.ps1 Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env pwsh
echo "Building for win-x64"
cargo build --workspace
New-Item "bin/win-x64" -ItemType Directory -Force
Remove-Item -Path "bin/win-x64/*" -Force -Recurse
Copy-Item -Path "target/debug/tribufu_sdk.dll.lib" -Destination "bin/win-x64/tribufu_sdk.lib"
Copy-Item -Path "target/debug/tribufu_sdk.dll" -Destination "bin/win-x64/tribufu_sdk.dll"
msbuild /p:Configuration="debug" /p:Platform="win-x64"

View File

@ -0,0 +1,3 @@
@echo off
call .\vendor\premake-core\windows\premake5.exe vs2022