Skip to content

Commit

Permalink
Fixing dependency usage for wasm
Browse files Browse the repository at this point in the history
The main change is moving the gooey-kludgine dependency into a
platform-specific dependency.
  • Loading branch information
ecton committed Aug 30, 2023
1 parent 2faa189 commit e6c461a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ raster = ["dep:gooey-raster", "gooey-widgets/raster"]
[dependencies]
gooey-core = { workspace = true }
gooey-widgets = { workspace = true }
gooey-web = { workspace = true, optional = true }
gooey-raster = { workspace = true, optional = true }
wasm-bindgen = { version = "*", optional = true }
log = "0.4"

[target.'cfg(target_arch = "wasm32")'.dependencies]
gooey-web = { workspace = true, optional = true }
wasm-bindgen = { version = "*", optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
gooey-kludgine = { workspace = true, optional = true }


[workspace]
resolver = "2"
members = [
"crates/gooey-reactor",
"crates/gooey-core",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ directory in the repository.
1. Compile the example:

```sh
cargo build --example counter --target wasm32-unknown-unknown --no-default-features --features web
cargo build --example counter --target wasm32-unknown-unknown
```

2. Generate the wasm bindings:
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::sync::Arc;
use gooey_core::Context;
#[cfg(feature = "raster")]
pub use gooey_raster as raster;
#[cfg(feature = "web")]
#[cfg(all(feature = "web", target_arch = "wasm32"))]
pub use gooey_web as web;
pub use {gooey_core as core, gooey_widgets as widgets};

Expand Down

0 comments on commit e6c461a

Please sign in to comment.