blob: 13e78b16699b5cc531583ed3d6c43cc590619e6f [file] [log] [blame]
#[[
## Overview
To build a `rust_binary` for `wasm32-unknown-unknown` target add the `--platforms=@rules_rust//rust/platform:wasm` flag.
```command
bazel build @examples//hello_world_wasm --platforms=@rules_rust//rust/platform:wasm
```
To build a `rust_binary` for `wasm32-wasi` target add the `--platforms=@rules_rust//rust/platform:wasi` flag.
```command
bazel build @examples//hello_world_wasm --platforms=@rules_rust//rust/platform:wasi
```
`rust_wasm_bindgen` will automatically transition to the `wasm` platform and can be used when
building WebAssembly code for the host target.
]]#