Skip to content

Commit

Permalink
just-webrtc-signalling/Cargo.toml: better optional deps
Browse files Browse the repository at this point in the history
  • Loading branch information
poshcoe committed Mar 28, 2024
1 parent f760e4f commit 813d90e
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions crates/just-webrtc-signalling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,23 @@ version = "0.1.0"
edition = "2021"

[dependencies]
log = "0.4"
prost = "0.12.3"
#client deps (all targets)
log = { version = "0.4", optional = true }
thiserror = { version = "1.0", optional = true }
anyhow = { version = "1.0", optional = true }
bincode = { version = "1.3", optional = true }
futures = { version = "0.3.30", optional = true }
futures-util = { version = "0.3.30", optional = true }
serde = { version = "1.0", optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
tonic = { version = "0.11.0", default-features = false, features = ["prost", "codegen"] } # no included transport layer
tonic-web-wasm-client = { version = "0.5.1" } # transport layer for tonic clients over WASM
tonic = { version = "0.11.0", default-features = false, features = ["prost", "codegen"], optional = true } # no included transport layer
tonic-web-wasm-client = { version = "0.5.1", optional = true } # transport layer for tonic clients over WASM

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tonic = { version = "0.11.0", default-features = false, features = ["prost", "codegen", "transport", "tls"] } # include native transport layer
tonic = { version = "0.11.0", default-features = false, features = ["prost", "codegen", "transport", "tls"], optional = true } # include native transport layer
tokio-stream = { version = "0.1.14", optional = true }
tokio = { version = "1", features = ["rt-multi-thread", "macros"], optional = true }
slotmap = { version = "1", optional = true }
tokio = { version = "1.36", features = ["sync"], optional = true }
async-stream = { version = "0.3.5", optional = true }
pretty_env_logger = { version = "0.5", optional = true }
tower-http = { version = "0.4", features = ["cors"], optional = true }
http = { version = "0.2.12", optional = true }
tonic-web = { version = "0.11.0", optional = true }
Expand All @@ -34,11 +31,12 @@ tonic-build = { version = "0.11.0", default-features = false, features = ["prost
[features]
default = ["server", "server-web", "client"]
server = [
"dep:tonic",
"dep:tokio",
"dep:tokio-stream",
"dep:slotmap",
"dep:pretty_env_logger",
"dep:async-stream",
"dep:log",
"dep:futures-util",
]
server-web = [
"server",
Expand All @@ -47,9 +45,12 @@ server-web = [
"dep:tonic-web",
]
client = [
"dep:tonic",
"dep:tonic-web-wasm-client",
"dep:bincode",
"dep:thiserror",
"dep:anyhow",
"dep:futures",
"dep:futures-util",
"dep:serde",
"dep:log",
]

0 comments on commit 813d90e

Please sign in to comment.