Some cleanups for wasm and asmjs
authorBernie Innocenti <bernie@codewiz.org>
Mon, 1 May 2017 01:15:51 +0000 (21:15 -0400)
committerBernie Innocenti <bernie@codewiz.org>
Mon, 1 May 2017 01:15:51 +0000 (21:15 -0400)
Cargo.toml
debug.sh
main.rs
release.sh [deleted file]
release_asmjs.sh [new file with mode: 0755]
release_wasm.sh

index 2ca01347ff091b7956603a789cd66ab0861916d7..4e9fd35cfc9b82bb51e6bc0c3e6c3215353de75c 100644 (file)
@@ -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 = "*"
index 3c2d514aeaf624119778b1164dd4a3bd3c62dd39..cb4f144e372b2246b5c9f9b4371932d3412cf7c4 100755 (executable)
--- 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 e0d2ad2df089ae64fe881c29b3341118d6c18d79..9c223c90973673d8493c6d7b780642ecc2d933d6 100644 (file)
--- 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 (executable)
index 262849a..0000000
+++ /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 (executable)
index 0000000..d03a92d
--- /dev/null
@@ -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 .
index df96bcf93d08716a68ad562d4227229d20c48ece..fc6d92644f6785f1ca7c9e092b5a0eafc3d4ce12 100755 (executable)
@@ -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 .