Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,25 @@ get too messy either.
- Install Rust from https://rustup.rs/
- Run `rustup target add arm-unknown-linux-gnueabihf`
- Install `sudo apt install libclang-dev`
- Build with `cargo build`

## Cross-compiling on Ubuntu/Debian
- Install Rust from https://rustup.rs/
- Run `rustup target add arm-unknown-linux-gnueabihf`
- Install `sudo apt install libclang-dev gcc-arm-linux-gnueabihf`
- Create the directory `.cargo` in the root of your Rust project and create a local cargo configuration file `config.toml` in it.
- Paste the following lines into `config.toml` to always build for the `arm-unknown-linux-gnueabihf` target, to use the GCC linker for this architecture and to set the sysroot so that the linker can find the necessary header files:
```
[build]
target = "arm-unknown-linux-gnueabihf"

[target.arm-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[env]
RPI_WS281X_SYSROOT = "/usr/arm-linux-gnueabihf"
```
- Build with `cargo build`

### AArch64 Builds
- Run `rustup target add aarch64-unknown-linux-gnu`
Expand Down