Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add wasm32-unknown-unknown support through stdweb #589

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ categories = ["gui"]
features = ["icon_loading"]

[features]
default = ["stdweb"]

icon_loading = ["image"]

[dependencies]
lazy_static = "1"
libc = "0.2"
image = { version = "0.19", optional = true }
stdweb = { git = "https://github.com/koute/stdweb", optional = true }

[target.'cfg(target_os = "android")'.dependencies.android_glue]
version = "0.2"
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ extern crate parking_lot;
extern crate percent_encoding;
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd"))]
extern crate smithay_client_toolkit as sctk;
#[cfg(all(feature = "stdweb", target_arch = "wasm32"))]
extern crate stdweb;

pub(crate) use dpi::*; // TODO: Actually change the imports throughout the codebase.
pub use events::*;
Expand Down
6 changes: 5 additions & 1 deletion src/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ mod platform;
#[cfg(target_os = "emscripten")]
#[path="emscripten/mod.rs"]
mod platform;
#[cfg(all(feature = "stdweb", target_arch = "wasm32"))]
#[path="stdweb/mod.rs"]
mod platform;

#[cfg(all(not(target_os = "ios"), not(target_os = "windows"), not(target_os = "linux"),
not(target_os = "macos"), not(target_os = "android"), not(target_os = "dragonfly"),
not(target_os = "freebsd"), not(target_os = "openbsd"), not(target_os = "emscripten")))]
not(target_os = "freebsd"), not(target_os = "openbsd"), not(target_os = "emscripten"),
not(all(feature = "stdweb", target_arch = "wasm32"))))]
compile_error!("The platform you're compiling for is not supported by winit");
Loading