Skip to content

Commit

Permalink
wasm as platform dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
goulart-paul committed Nov 26, 2024
1 parent 7036899 commit 556c289
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ julia = ["sdp", "dep:libc", "dep:num-derive", "serde", "faer-sparse"]
# enable a blas/lapack source package
python = ["sdp", "dep:libc", "dep:pyo3", "dep:num-derive", "serde", "faer-sparse"]

wasm = ["dep:web-time"]

#compile with faer supernodal solver option
faer-sparse = ["dep:faer", "dep:faer-entity"]

Expand Down Expand Up @@ -200,9 +198,8 @@ features = ["sdp","sdp-mkl"]
# wasm compatibility
# ------------------------------

[dependencies.web-time]
optional = true
version = "0.2.3"
[target.'cfg(target_family = "wasm")'.dependencies]
web-time = "0.2.3"

# ------------------------------
# testing, benchmarking etc
Expand Down
3 changes: 1 addition & 2 deletions src/timers/timers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ use std::collections::HashMap;
use std::ops::{Deref, DerefMut};

cfg_if::cfg_if! {
if #[cfg(feature="wasm")] {
if #[cfg(target_family = "wasm")] {
use web_time::{Duration, Instant};
}
else {
use std::time::{Duration, Instant};
}
}


#[derive(Debug, Default)]
struct InnerTimer {
Expand Down

0 comments on commit 556c289

Please sign in to comment.