cpal icon indicating copy to clipboard operation
cpal copied to clipboard

Support for wasm32-wasi-* targets

Open koniifer opened this issue 1 year ago • 0 comments

EDIT: it does seem that wasi targets, while compiling with this change, are incapable of producing functional binaries. As such I can only assume that there is either no functional audio api, or that wasm runtimes do not support them.

Currently wasm32-wasi-* targets are unsupported (wasi, wasi-preview1-threads, and soon wasi-preview2). However, changing the Cargo.toml to support them would likely not break unknown-unknown or unknown-emscripten. I propose changing one line in the Cargo.toml:

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]

to

[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]

which would enable wasm specific dependencies on wasm32-wasi-* targets.

I can submit a pull request if necessary.

Thanks <3

koniifer avatar Feb 13 '24 13:02 koniifer