diff --git a/Bootstrap.ps1 b/Bootstrap.ps1 new file mode 100644 index 0000000..9f28373 --- /dev/null +++ b/Bootstrap.ps1 @@ -0,0 +1,38 @@ +#!/usr/bin/env pwsh + +echo "Installing dependencies..." + +cargo install cbindgen + +echo "Generating bindings..." + +cbindgen --config ./Config/Bindings.toml --crate tribufu --output ./Source/Header.h + +# 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" +} diff --git a/Bootstrap.sh b/Bootstrap.sh new file mode 100644 index 0000000..a2eb205 --- /dev/null +++ b/Bootstrap.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env sh + +echo "Installing dependencies..." + +cargo install cbindgen + +echo "Generating bindings..." + +cbindgen --config ./Config/Bindings.toml --crate tribufu --output ./Source/Header.h + +# 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 diff --git a/GenerateProjectFiles.bat b/GenerateProjectFiles.bat deleted file mode 100644 index 3dd589c..0000000 --- a/GenerateProjectFiles.bat +++ /dev/null @@ -1,2 +0,0 @@ -cbindgen --config .\Config\Bindings.toml --crate tribufu --output Source\Header.h -call .\Vendor\Premake\Windows\premake5.exe vs2019 diff --git a/GenerateProjectFiles.command b/GenerateProjectFiles.command deleted file mode 100644 index 673f1b0..0000000 --- a/GenerateProjectFiles.command +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/zsh - -cbindgen --config ./Config/Bindings.toml --crate tribufu --output Source/Header.h -sudo ./Vendor/Premake/Mac/premake5 xcode4 diff --git a/GenerateProjectFiles.sh b/GenerateProjectFiles.sh deleted file mode 100644 index 3606bd7..0000000 --- a/GenerateProjectFiles.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cbindgen --config ./Config/Bindings.toml --crate tribufu --output Source/Header.h -sudo ./Vendor/Premake/Linux/premake5 gmake2