Update Bindings Generating

This commit is contained in:
GuilhermeWerner
2021-04-18 20:02:07 -03:00
parent fae4be1606
commit b82addd7e5
12 changed files with 103 additions and 20 deletions

3
.gitignore vendored
View File

@ -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
View 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
View 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

View File

@ -1,2 +0,0 @@
cbindgen --config .\Config\Bindings.toml --crate Library --output Source\Library.h
call .\Premake\Windows\premake5.exe vs2019

View File

@ -1,4 +0,0 @@
#!/bin/zsh
cbindgen --config ./Config/Bindings.toml --crate Library --output Source/Library.h
sudo ./Premake/Mac/premake5 xcode4

View File

@ -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
View File

BIN
Vendor/rcedit.exe vendored Normal file

Binary file not shown.

View File

@ -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"