From: Bernie Innocenti Date: Mon, 1 May 2017 01:15:51 +0000 (-0400) Subject: Some cleanups for wasm and asmjs X-Git-Tag: v0.6.0~5 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=71da4db85741e2f43ba40341e0baec34ff41bb92;p=mandelwow.git Some cleanups for wasm and asmjs --- 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.sh deleted file mode 100755 index 262849a..0000000 --- a/release.sh +++ /dev/null @@ -1,4 +0,0 @@ -set -e -cargo rustc --target asmjs-unknown-emscripten --release -- -C link-args='-s USE_SDL=2' -cp target/asmjs-unknown-emscripten/release/mandelwow.js . -emrun . diff --git a/release_asmjs.sh b/release_asmjs.sh new file mode 100755 index 0000000..d03a92d --- /dev/null +++ b/release_asmjs.sh @@ -0,0 +1,4 @@ +set -e +cargo rustc --target asmjs-unknown-emscripten --release -- -C link-args='-s USE_SDL=2' +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 .