blob: 13e78b16699b5cc531583ed3d6c43cc590619e6f [file] [log] [blame]
Brian Silvermancc09f182022-03-09 15:40:20 -08001#[[
2## Overview
3
4To build a `rust_binary` for `wasm32-unknown-unknown` target add the `--platforms=@rules_rust//rust/platform:wasm` flag.
5
6```command
7bazel build @examples//hello_world_wasm --platforms=@rules_rust//rust/platform:wasm
8```
9
10To build a `rust_binary` for `wasm32-wasi` target add the `--platforms=@rules_rust//rust/platform:wasi` flag.
11
12```command
13bazel build @examples//hello_world_wasm --platforms=@rules_rust//rust/platform:wasi
14```
15
16`rust_wasm_bindgen` will automatically transition to the `wasm` platform and can be used when
17building WebAssembly code for the host target.
18]]#