From 71da4db85741e2f43ba40341e0baec34ff41bb92 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Sun, 30 Apr 2017 21:15:51 -0400 Subject: [PATCH] Some cleanups for wasm and asmjs --- Cargo.toml | 4 ++-- debug.sh | 4 ++-- main.rs | 2 ++ release.sh => release_asmjs.sh | 2 +- release_wasm.sh | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) rename release.sh => release_asmjs.sh (62%) diff --git a/Cargo.toml b/Cargo.toml index 2ca0134..4e9fd35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,14 +6,14 @@ license = "GPL-3.0+" [profile.release] #lto = true -#panic = 'abort' +panic = 'abort' [dependencies] cgmath = "*" glium = "0.16.0" glutin = "0.7.4" genmesh = "0.4.1" -image = "0.12.0" +image = { version = "0.13.0", features = ["png_codec"] } obj = { version = "0.5", features = ["usegenmesh"] } libxm = "1.0.0" sdl2 = "*" diff --git a/debug.sh b/debug.sh index 3c2d514..cb4f144 100755 --- a/debug.sh +++ b/debug.sh @@ -1,5 +1,5 @@ set -e cargo rustc --target asmjs-unknown-emscripten -- -C link-args='-s USE_SDL=2 --preload-file flora.xm' -cp target/asmjs-unknown-emscripten/debug/mandelwow.js . -cp target/asmjs-unknown-emscripten/debug/deps/mandelwow-ec0c575eb8c2718a.data . +cp -a target/asmjs-unknown-emscripten/debug/mandelwow.js . +cp -a target/asmjs-unknown-emscripten/debug/deps/mandelwow-*.data . emrun . diff --git a/main.rs b/main.rs index e0d2ad2..9c223c9 100644 --- a/main.rs +++ b/main.rs @@ -13,6 +13,8 @@ use glium::{DisplayBuild, Surface}; use glutin::ElementState::Pressed; use glutin::Event::KeyboardInput; use glutin::VirtualKeyCode; + +#[cfg(target_os = "emscripten")] use std::os::raw::{c_int, c_void}; mod bounding_box; diff --git a/release.sh b/release_asmjs.sh similarity index 62% rename from release.sh rename to release_asmjs.sh index 262849a..d03a92d 100755 --- a/release.sh +++ b/release_asmjs.sh @@ -1,4 +1,4 @@ set -e cargo rustc --target asmjs-unknown-emscripten --release -- -C link-args='-s USE_SDL=2' -cp target/asmjs-unknown-emscripten/release/mandelwow.js . +cp -a target/asmjs-unknown-emscripten/release/mandelwow.js . emrun . diff --git a/release_wasm.sh b/release_wasm.sh index df96bcf..fc6d926 100755 --- a/release_wasm.sh +++ b/release_wasm.sh @@ -1,5 +1,5 @@ set -e cargo rustc --target wasm32-unknown-emscripten --release -- -C link-args='-s USE_SDL=2 --preload-file flora.xm' -cp target/wasm32-unknown-emscripten/release/mandelwow.js . -cp target/wasm32-unknown-emscripten/release/deps/mandelwow-*.{wasm,data} . +cp -a target/wasm32-unknown-emscripten/release/mandelwow.js . +cp -a target/wasm32-unknown-emscripten/release/deps/mandelwow-*.{wasm,data} . emrun . -- 2.25.1