Compile to WASM using Emscripten #31

Merged
rafaelcaricio merged 1 commit from emscripten into master 2020-09-22 18:54:48 +00:00
rafaelcaricio commented 2020-09-21 18:03:04 +00:00 (Migrated from github.com)

This makes it possible to compile lvgl-rs to WASM using the target wasm32-unknown-emscripten.

This makes it possible to compile `lvgl-rs` to WASM using the target `wasm32-unknown-emscripten`.
rafaelcaricio (Migrated from github.com) reviewed 2020-09-22 08:32:41 +00:00
@ -73,0 +88,4 @@
additional_args.push(format!("{}/upstream/emscripten/system/lib/libc/musl/arch/emscripten", em_path));
additional_args.push("-I".to_string());
additional_args.push(format!("{}/upstream/emscripten/system/include/SDL", em_path));
}
rafaelcaricio (Migrated from github.com) commented 2020-09-22 08:32:41 +00:00

This won't work on Windows...

This won't work on Windows...
rafaelcaricio (Migrated from github.com) reviewed 2020-09-22 08:33:54 +00:00
@ -73,0 +82,4 @@
let mut additional_args = Vec::new();
if target.ends_with("emscripten") {
if let Ok(em_path) = env::var("EMSDK") {
additional_args.push("-I".to_string());
rafaelcaricio (Migrated from github.com) commented 2020-09-22 08:33:53 +00:00

If it's not present we could show an error, tell users that they are missing to activate the Emscripten environment.

# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh
If it's not present we could show an error, tell users that they are missing to activate the Emscripten environment. ``` # Activate PATH and other environment variables in the current terminal source ./emsdk_env.sh ```
Sign in to join this conversation.
No description provided.