]> git.lizzy.rs Git - rust.git/blob - src/doc/rustc/src/targets/custom.md
Merge commit '8d14c94b5c0a66241b4244f1c60ac5859cec1d97' into clippyup
[rust.git] / src / doc / rustc / src / targets / custom.md
1 # Custom Targets
2
3 If you'd like to build for a target that is not yet supported by `rustc`, you can use a
4 "custom target specification" to define a target. These target specification files
5 are JSON. To see the JSON for the host target, you can run:
6
7 ```bash
8 $ rustc +nightly -Z unstable-options --print target-spec-json
9 ```
10
11 To see it for a different target, add the `--target` flag:
12
13 ```bash
14 $ rustc +nightly -Z unstable-options --target=wasm32-unknown-unknown --print target-spec-json
15 ```
16
17 To use a custom target, see the (unstable) [`build-std` feature](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std) of `cargo`.