cross compile scripts

This commit is contained in:
Evan Pratten 2021-04-06 10:48:07 -04:00
parent f7d8765ddb
commit 6cc33f7a6f
9 changed files with 58 additions and 2 deletions

2
.gitignore vendored
View File

@ -14,3 +14,5 @@ Cargo.lock
# Added by cargo
/target
.project

View File

@ -3,9 +3,9 @@ name = "ludum-dare-48"
version = "0.1.0"
authors = ["Evan Pratten <ewpratten@gmail.com>"]
edition = "2018"
description = ""
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
raylib = "3.5"
include-flate = "0.1.3"
raylib = "3.5"

2
Cross.toml Normal file
View File

@ -0,0 +1,2 @@
[target.x86_64-unknown-linux-gnu]
image = "ldjam_48_x86_64_unknown_linux_gnu_build_env"

0
assets/.gitkeep Normal file
View File

2
bundle/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*/*.zip
*/release

7
bundle/create-releases.sh Executable file
View File

@ -0,0 +1,7 @@
#! /bin/bash
set -e
# Build all platforms
./bundle/linux/create-release.sh
./bundle/windows/create-release.sh

4
bundle/linux/Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM rustembedded/cross:x86_64-unknown-linux-gnu-0.2.1
RUN apt-get update -y
RUN apt-get install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev -y

20
bundle/linux/create-release.sh Executable file
View File

@ -0,0 +1,20 @@
#! /bin/bash
set -e
echo "Building for x64 Linux"
docker build -t ldjam_48_x86_64_unknown_linux_gnu_build_env ./bundle/linux
cross build --target x86_64-unknown-linux-gnu --release
echo "Creating bundle output"
rm -rf ./bundle/linux/release
mkdir -p ./bundle/linux/release
echo "Copying binary"
cp ./target/x86_64-unknown-linux-gnu/release/ludum-dare-48 ./bundle/linux/release
echo "Copying assets"
cp -r ./assets ./bundle/linux/release
echo "Packing assets"
zip -r ./bundle/linux/release-x86_64-unknown-linux-gnu.zip ./bundle/linux/release

View File

@ -0,0 +1,19 @@
#! /bin/bash
set -e
echo "Building for x64 Windows"
cross build --target x86_64-pc-windows-gnu --release
echo "Creating bundle output"
rm -rf ./bundle/windows/release
mkdir -p ./bundle/windows/release
echo "Copying binary"
cp ./target/x86_64-pc-windows-gnu/release/ludum-dare-48.exe ./bundle/windows/release
echo "Copying assets"
cp -r ./assets ./bundle/windows/release
echo "Packing assets"
zip -r ./bundle/windows/release-x86_64-pc-windows-gnu.zip ./bundle/windows/release