Split WASM and native versions, and move iced support code to native

This commit is contained in:
2026-03-27 00:27:34 -05:00
parent 3010469c8a
commit b433148843
23 changed files with 2330 additions and 1012 deletions

View File

@@ -3,18 +3,52 @@ name = "nes-emu"
version = "0.1.0"
edition = "2024"
[features]
default = []
iced = [
"dep:iced", "iced/debug", "iced/canvas", "iced/lazy", "iced/image", "iced/advanced", "tokio", "fs"
]
fs = []
tokio = ["iced/tokio", "dep:tokio", "tokio/time", "tokio/fs"]
iced_wasm = ["dep:iced"]
audio = ["dep:cpal", "dep:ringbuf"]
web = ["dep:web-sys", "dep:web-sys"]
[dependencies]
bitfield = "0.19.3"
# iced = { version = "0.14.0", features = ["debug", "canvas", "tokio", "lazy", "image", "advanced"] }
iced = { path = "../iced", features = ["debug", "canvas", "tokio", "lazy", "image", "advanced"] }
iced_core = { path = "../iced/core", features = ["advanced"] }
rfd = "0.17.2"
# iced_graphics = { version = "0.14.0", features = ["geometry", "image"] }
# iced_widget = { version = "0.13.4", features = ["canvas", "image"] }
thiserror = "2.0.17"
tokio = { version = "1.48.0", features = ["full"] }
thiserror = "2.0.18"
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.20", features = ["ansi", "chrono", "env-filter", "json", "serde"] }
bytes = "*"
cpal = "0.17.1"
ringbuf = "0.4.8"
# yew = { version = "0.23", features = ["csr"], optional = true }
web-sys = { version = "*", features = [
"HtmlCanvasElement", "CanvasRenderingContext2d",
"Window", "Document", "KeyboardEvent",
"DocumentTimeline", "AudioContextState",
"HtmlButtonElement",
"HtmlInputElement", "FileList", "File", "Blob",
"ImageBitmap", "ImageData",
"AudioContext", "AudioContextOptions",
"AudioBuffer", "AudioBufferOptions", "AudioDestinationNode", "AudioBufferSourceNode",
"GainNode", "AudioParam", "DelayNode"
], optional = true }
cpal = { version = "0.17.1", optional = true}
ringbuf = { version = "0.4.8", optional = true}
iced = { path = "../iced", features = [], optional = true }
# iced_core = { path = "../iced/core", features = ["advanced"], optional = true }
rfd = { version = "0.17.2", optional = true }
tokio = { version = "1.48.0", features = [], optional = true }
log = "*"
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
console_log = "1.0"
[[bin]]
name = "native"
required-features = ["iced", "rfd", "audio"]
[[bin]]
name = "wasm"
required-features = ["web"]