diff --git a/dgram/Cargo.toml b/dgram/Cargo.toml index f40427405b..c72e93a358 100644 --- a/dgram/Cargo.toml +++ b/dgram/Cargo.toml @@ -3,8 +3,11 @@ name = "dgram" version = "0.1.0" edition = "2021" +[features] +async = ["dep:tokio"] + [dependencies] libc = "0.2.76" nix = "0.26.2" smallvec = { version = "1.10", features = ["union"] } -tokio = { version = "1.29", features = ["full", "test-util"] } +tokio = { version = "1.29", features = ["full", "test-util"], optional = true } diff --git a/dgram/src/lib.rs b/dgram/src/lib.rs index 88159beb17..a484cce649 100644 --- a/dgram/src/lib.rs +++ b/dgram/src/lib.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "async")] pub mod async_socket; pub mod socket; pub mod syscalls;