mirror of
https://github.com/guilhermewerner/rust-ffi
synced 2025-06-15 05:14:18 +00:00
Update Bindings Generating
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -9,7 +9,7 @@ Cargo.lock
|
||||
|
||||
# FFI Bindings
|
||||
|
||||
Source/Library.h
|
||||
Header.h
|
||||
|
||||
# Visual Studio Project Files
|
||||
|
||||
@ -24,6 +24,7 @@ Source/Library.h
|
||||
# CMake Project Files
|
||||
|
||||
Makefile
|
||||
*.make
|
||||
|
||||
# Xcode Project Files
|
||||
|
||||
|
38
Bootstrap.ps1
Normal file
38
Bootstrap.ps1
Normal file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
echo "Installing dependencies..."
|
||||
|
||||
cargo install cbindgen
|
||||
|
||||
echo "Generating bindings..."
|
||||
|
||||
cbindgen --config ./Config/Bindings.toml --crate Library --output ./Source/Header.h --quiet
|
||||
|
||||
# Windows
|
||||
|
||||
if ($IsWindows)
|
||||
{
|
||||
echo "Generating Visual Studio project..."
|
||||
|
||||
& "./Vendor/Premake/Windows/premake5.exe" "vs2019"
|
||||
}
|
||||
|
||||
# Mac
|
||||
|
||||
elseif ($IsMacOS)
|
||||
{
|
||||
echo "Generating XCode project..."
|
||||
|
||||
sudo chmod +x ./Vendor/Premake/Mac/premake5
|
||||
& "./Vendor/Premake/Mac/premake5" "xcode4"
|
||||
}
|
||||
|
||||
# Linux
|
||||
|
||||
elseif ($IsLinux)
|
||||
{
|
||||
echo "Generating GMake project..."
|
||||
|
||||
sudo chmod +x ./Vendor/Premake/Linux/premake5
|
||||
& "./Vendor/Premake/Linux/premake5" "gmake2"
|
||||
}
|
28
Bootstrap.sh
Normal file
28
Bootstrap.sh
Normal file
@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
echo "Installing dependencies..."
|
||||
|
||||
cargo install cbindgen
|
||||
|
||||
echo "Generating bindings..."
|
||||
|
||||
cbindgen --config ./Config/Bindings.toml --crate Library --output ./Source/Header.h --quiet
|
||||
|
||||
# Linux
|
||||
|
||||
if [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]
|
||||
then
|
||||
echo "Generating GMake project..."
|
||||
|
||||
sudo chmod +x ./Vendor/Premake/Linux/premake5
|
||||
./Vendor/Premake/Linux/premake5 gmake2
|
||||
|
||||
# Mac
|
||||
|
||||
elif [ "$(uname)" = "Darwin" ]
|
||||
then
|
||||
echo "Generating XCode project..."
|
||||
|
||||
sudo chmod +x ./Vendor/Premake/Mac/premake5
|
||||
./Vendor/Premake/Mac/premake5 xcode4
|
||||
fi
|
@ -1,2 +0,0 @@
|
||||
cbindgen --config .\Config\Bindings.toml --crate Library --output Source\Library.h
|
||||
call .\Premake\Windows\premake5.exe vs2019
|
@ -1,4 +0,0 @@
|
||||
#!/bin/zsh
|
||||
|
||||
cbindgen --config ./Config/Bindings.toml --crate Library --output Source/Library.h
|
||||
sudo ./Premake/Mac/premake5 xcode4
|
@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cbindgen --config ./Config/Bindings.toml --crate Library --output Source/Library.h
|
||||
sudo ./Premake/Linux/premake5 gmake2
|
0
Premake/Linux/premake5 → Vendor/Premake/Linux/premake5
vendored
Executable file → Normal file
0
Premake/Linux/premake5 → Vendor/Premake/Linux/premake5
vendored
Executable file → Normal file
BIN
Vendor/rcedit.exe
vendored
Normal file
BIN
Vendor/rcedit.exe
vendored
Normal file
Binary file not shown.
44
premake5.lua
44
premake5.lua
@ -34,7 +34,6 @@ project "Cpp"
|
||||
}
|
||||
|
||||
filter "system:windows"
|
||||
cppdialect "C++17"
|
||||
staticruntime "On"
|
||||
systemversion "latest"
|
||||
|
||||
@ -45,14 +44,24 @@ project "Cpp"
|
||||
|
||||
filter { "system:windows", "configurations:debug" }
|
||||
runtime "Debug"
|
||||
buildoptions "/MDd"
|
||||
symbols "on"
|
||||
|
||||
filter { "system:windows", "configurations:release" }
|
||||
runtime "Release"
|
||||
buildoptions "/MD"
|
||||
optimize "on"
|
||||
|
||||
filter "system:linux"
|
||||
links
|
||||
{
|
||||
"Library"
|
||||
}
|
||||
|
||||
filter "system:darwin"
|
||||
links
|
||||
{
|
||||
"Library"
|
||||
}
|
||||
|
||||
project "C"
|
||||
location "Examples/C"
|
||||
kind "ConsoleApp"
|
||||
@ -88,17 +97,36 @@ project "C"
|
||||
|
||||
filter { "system:windows", "configurations:debug" }
|
||||
runtime "Debug"
|
||||
buildoptions "/MDd"
|
||||
symbols "on"
|
||||
|
||||
filter { "system:windows", "configurations:release" }
|
||||
runtime "Release"
|
||||
buildoptions "/MD"
|
||||
optimize "on"
|
||||
|
||||
filter "system:linux"
|
||||
links
|
||||
{
|
||||
"Library"
|
||||
}
|
||||
|
||||
filter "system:darwin"
|
||||
links
|
||||
{
|
||||
"Library"
|
||||
}
|
||||
|
||||
project "CSharp"
|
||||
location "Examples/CSharp"
|
||||
kind "ConsoleApp"
|
||||
|
||||
filter { "system:windows" }
|
||||
kind "ConsoleApp"
|
||||
filter { "system:linux" }
|
||||
kind "None"
|
||||
filter { "system:darwin" }
|
||||
kind "None"
|
||||
|
||||
filter {}
|
||||
|
||||
language "C#"
|
||||
|
||||
targetdir ("Binaries/" .. outputDir)
|
||||
@ -125,15 +153,13 @@ project "CSharp"
|
||||
|
||||
defines
|
||||
{
|
||||
"WINDOWS_PLATFORM"
|
||||
"PLATFORM_WINDOWS"
|
||||
}
|
||||
|
||||
filter { "system:windows", "configurations:debug" }
|
||||
runtime "Debug"
|
||||
buildoptions "/MDd"
|
||||
symbols "on"
|
||||
|
||||
filter { "system:windows", "configurations:release" }
|
||||
runtime "Release"
|
||||
buildoptions "/MD"
|
||||
optimize "on"
|
||||
|
Reference in New Issue
Block a user