Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
CryZe committed Oct 28, 2019
1 parent c09350f commit ef9b72d
Show file tree
Hide file tree
Showing 7 changed files with 488 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ more-image-formats = ["image/webp", "image/pnm", "image/ico", "image/jpeg", "ima
image-shrinking = ["more-image-formats"]
rendering = ["more-image-formats", "euclid", "livesplit-title-abbreviations", "lyon", "rusttype", "smallvec"]
software-rendering = ["rendering", "euc", "vek"]
wasm-web = ["web-sys", "chrono/wasmbind"]
wasm-web = ["web-sys", "chrono/wasmbind", "livesplit-hotkey/wasm-web"]

[[bench]]
name = "balanced_pb"
Expand Down
7 changes: 6 additions & 1 deletion crates/livesplit-hotkey/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,10 @@ stdweb = "0.3.0"
parking_lot = "0.9.0"

[dependencies]
snafu = { version = "0.5.0", default-features = false, features = ["rust_1_30"] }
cfg-if = "0.1.10"
serde = { version = "1.0.55", features = ["derive"] }
snafu = { version = "0.5.0", default-features = false, features = ["rust_1_30"] }

[features]
default = []
wasm-web = []
64 changes: 27 additions & 37 deletions crates/livesplit-hotkey/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,40 +1,30 @@
// For js! macro.
#![recursion_limit = "1024"]

#[cfg(windows)]
pub mod windows;
#[cfg(windows)]
pub use crate::windows::*;

#[cfg(target_os = "linux")]
pub mod linux;
#[cfg(target_os = "linux")]
pub use crate::linux::*;

#[cfg(target_os = "emscripten")]
pub mod emscripten;
#[cfg(target_os = "emscripten")]
pub use crate::emscripten::*;
#[cfg(target_os = "emscripten")]
#[macro_use]
extern crate stdweb;

#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
pub mod wasm;
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
pub use crate::wasm::*;

#[cfg(not(any(
windows,
target_os = "linux",
target_os = "emscripten",
all(target_arch = "wasm32", target_os = "unknown")
)))]
pub mod other;
#[cfg(not(any(
windows,
target_os = "linux",
target_os = "emscripten",
all(target_arch = "wasm32", target_os = "unknown")
)))]
pub use crate::other::*;
cfg_if::cfg_if! {
if #[cfg(windows)] {
mod windows;
pub use self::windows::*;
} else if #[cfg(target_os = "linux")] {
mod linux;
pub use self::linux::*;
} else if #[cfg(target_os = "emscripten")] {
mod emscripten;
pub use self::emscripten::*;
#[macro_use]
extern crate stdweb;
} else if #[cfg(all(target_arch = "wasm32", target_os = "unknown"))] {
cfg_if::cfg_if! {
if #[cfg(feature = "wasm-web")] {
mod wasm_web;
pub use self::wasm_web::*;
} else {
mod wasm_unknown;
pub use self::wasm_unknown::*;
}
}
} else {
mod other;
pub use self::other::*;
}
}
File renamed without changes.
Loading

0 comments on commit ef9b72d

Please sign in to comment.