Skip to content

Commit

Permalink
Organize dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Jun 30, 2024
1 parent 99e1708 commit 2f7e0be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 5 additions & 3 deletions rust_crate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ documentation = "https://rinf.cunarist.com"
rust-version = "1.70"

[features]
default = ["bevy"]
rt-multi-thread = ["tokio/rt-multi-thread"]
show-backtrace = ["backtrace"]
bevy = ["dep:bevy_ecs"]
bevy = ["bevy_ecs"]

[dependencies]
bevy_ecs = { version = "0.13", optional = true }

[target.'cfg(not(target_family = "wasm"))'.dependencies]
os-thread-local = "0.1.3"
Expand All @@ -21,10 +25,8 @@ home = "0.5.9"
which = "6.0.0"
allo-isolate = "0.1.25"
tokio = { version = "1", features = ["rt"] }
bevy_ecs = { version = "0.13", optional = true }

[target.'cfg(target_family = "wasm")'.dependencies]
js-sys = "0.3.69"
wasm-bindgen = "0.2.92"
wasm-bindgen-futures = "0.4.42"
bevy_ecs = { version = "0.13", optional = true }
7 changes: 3 additions & 4 deletions rust_crate/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ use super::interface_os::*;
#[cfg(target_family = "wasm")]
use super::interface_web::*;

#[cfg(feature = "bevy")]
use bevy_ecs::event::Event;
/// This contains a message from Dart.
/// Optionally, a custom binary called `binary` can also be included.
/// This type is generic, and the message
/// can be of any type declared in Protobuf.
/// If the bevy feature is used, every message can be received as an event in Bevy.
#[cfg_attr(feature = "bevy", derive(Event))]
/// If the `bevy` feature is enabled,
/// every Dart signal can be received as an event in Bevy.
#[cfg_attr(feature = "bevy", derive(bevy_ecs::event::Event))]
pub struct DartSignal<T> {
/// The message instance of a struct generated by Protobuf.
pub message: T,
Expand Down

0 comments on commit 2f7e0be

Please sign in to comment.