[package]
name = "wasmtime-wasi"
version.workspace = true
authors.workspace = true
description = "WASI implementation in Rust"
license = "Apache-2.0 WITH LLVM-exception"
categories = ["wasm"]
keywords = ["webassembly", "wasm"]
repository = "https://github.com/bytecodealliance/wasmtime"
readme = "README.md"
edition.workspace = true
include = ["src/**/*", "README.md", "LICENSE", "build.rs", "witx/*", "wit/**/*"]
build = "build.rs"

[dependencies]
wasmtime = { workspace = true }
anyhow = { workspace = true }
wasi-common = { workspace = true }
wasi-cap-std-sync = { workspace = true, optional = true }
wasi-tokio = { workspace = true, optional = true }
wiggle = { workspace = true, optional = true }
libc = { workspace = true }
once_cell = { workspace = true }
log = { workspace = true }
url = { workspace = true }

tokio = { workspace = true, optional = true, features = ["time", "sync", "io-std", "io-util", "rt", "rt-multi-thread", "net"] }
bytes = { workspace = true }
thiserror = { workspace = true, optional = true }
tracing = { workspace = true, optional = true }
cap-std = { workspace = true, optional = true }
cap-rand = { workspace = true, optional = true }
cap-fs-ext = { workspace = true, optional = true }
cap-net-ext = { workspace = true, optional = true }
cap-time-ext = { workspace = true, optional = true }
io-lifetimes = { workspace = true, optional = true }
fs-set-times = { workspace = true, optional = true }
bitflags = { workspace = true, optional = true }
async-trait = { workspace = true, optional = true }
system-interface = { workspace = true, optional = true}
futures = { workspace = true, optional = true }

[dev-dependencies]
tokio = { workspace = true, features = ["time", "sync", "io-std", "io-util", "rt", "rt-multi-thread", "net", "macros"] }
test-log = { workspace = true }
tracing-subscriber = { workspace = true }
test-programs-artifacts = { workspace = true }
tempfile = { workspace = true }
wasmtime = { workspace = true, features = ['cranelift'] }

[target.'cfg(unix)'.dependencies]
rustix = { workspace = true, features = ["event", "fs", "net"], optional = true }

[target.'cfg(unix)'.dev-dependencies]
libc = { workspace = true }

[target.'cfg(windows)'.dependencies]
io-extras = { workspace = true }
windows-sys = { workspace = true }
rustix = { workspace = true, features = ["event", "net"], optional = true }

[features]
default = ["sync", "preview2", "preview1-on-preview2"]
sync = ["wasi-cap-std-sync", "wiggle"]
tokio = ["wasi-tokio", "wasmtime/async", "wiggle/wasmtime_async" ]
exit = []
preview2 = [
    'wasmtime/component-model',
    'wasmtime/async',
    'dep:thiserror',
    'dep:tracing',
    'dep:cap-std',
    'dep:cap-rand',
    'dep:cap-fs-ext',
    'dep:cap-net-ext',
    'dep:cap-time-ext',
    'dep:io-lifetimes',
    'dep:fs-set-times',
    'dep:bitflags',
    'dep:async-trait',
    'dep:system-interface',
    'dep:rustix',
    'dep:tokio',
    'dep:futures',
]
preview1-on-preview2 = [
    "preview2",
    "wiggle",
]
