Fix some publishing issues

This commit is contained in:
Evan Pratten 2021-04-06 19:21:29 -04:00
parent 4d152e071e
commit e135a75937
9 changed files with 58 additions and 4 deletions

3
.cargo/config.toml Normal file
View File

@ -0,0 +1,3 @@
[target.wasm32-unknown-emscripten]
# rustflags = ["-C", "link-args=-sUSE_GLFW=3"]
linker = "bundle/wasm/emcc.sh"

View File

@ -8,4 +8,5 @@ description = ""
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
raylib = "3.5"
raylib = { version = "3.5", git = "https://github.com/ewpratten/raylib-rs", branch = "cross_compile_fixes" }

View File

@ -1,2 +1,5 @@
[target.x86_64-unknown-linux-gnu]
image = "ldjam_48_x86_64_unknown_linux_gnu_build_env"
image = "ldjam_48_x86_64_unknown_linux_gnu_build_env"
[target.wasm32-unknown-emscripten]
image = "ldjam_48_wasm32_unknown_emscripten_build_env"

7
Web.toml Normal file
View File

@ -0,0 +1,7 @@
default-target = "wasm32-unknown-emscripten"
[cargo-web]
minimum-version = "0.6.0"
[target.emscripten]
link-args = ["-s", "USE_GLFW=3", "-s", "ASSERTIONS=1", "-s", "ASYNCIFY=1", "--profiling"]

View File

@ -17,4 +17,5 @@ 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
cd ./bundle/linux/release
zip -r ../release-x86_64-unknown-linux-gnu.zip ./

13
bundle/wasm/Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM rustembedded/cross:wasm32-unknown-emscripten-0.2.1
# System deps
RUN apt-get update -y
RUN apt-get install emscripten -y
RUN apt-get install gcc-multilib -y
RUN apt-get install curl -y
# Emscripten
# RUN emsdk update-tags
# RUN emsdk install sdk-incoming-64bit
# RUN emsdk activate sdk-incoming-64bit

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

@ -0,0 +1,20 @@
#! /bin/bash
set -e
echo "Building for 32-bit emscripten"
# docker build -t ldjam_48_wasm32_unknown_emscripten_build_env ./bundle/wasm
cross build --target wasm32-unknown-emscripten --release --verbose
echo "Creating bundle output"
rm -rf ./bundle/wasm/release
mkdir -p ./bundle/wasm/release
echo "Copying binary"
cp ./target/wasm32-unknown-emscripten/release/ludum-dare-48.exe ./bundle/wasm/release
echo "Copying assets"
cp -r ./assets ./bundle/wasm/release
echo "Packing assets"
zip -r ./bundle/wasm/release-wasm32-unknown-emscripten.zip ./bundle/wasm/release

5
bundle/wasm/emcc.sh Executable file
View File

@ -0,0 +1,5 @@
#! /bin/bash
set -e
emcc "-s" "USE_GLFW=3" "-s" "ASSERTIONS=1" "-s" "ASYNCIFY=1" $@

View File

@ -16,4 +16,5 @@ 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
cd ./bundle/windows/release
zip -r ../release-x86_64-pc-windows-gnu.zip ./