Cross-compilation instructions
This commit is contained in:
2
Cross.toml
Normal file
2
Cross.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main"
|
||||
22
README.md
22
README.md
@@ -115,6 +115,28 @@ cargo fmt
|
||||
cargo clippy
|
||||
```
|
||||
|
||||
## Cross-Compilation
|
||||
|
||||
To build a Linux x86_64 binary from macOS:
|
||||
|
||||
1. Install [cargo-zigbuild](https://github.com/rust-cross/cargo-zigbuild) and [Zig](https://ziglang.org/):
|
||||
```bash
|
||||
cargo install cargo-zigbuild
|
||||
brew install zig
|
||||
```
|
||||
|
||||
2. Add the Linux target:
|
||||
```bash
|
||||
rustup target add x86_64-unknown-linux-gnu
|
||||
```
|
||||
|
||||
3. Build:
|
||||
```bash
|
||||
cargo zigbuild --release --target x86_64-unknown-linux-gnu
|
||||
```
|
||||
|
||||
The binary will be at `target/x86_64-unknown-linux-gnu/release/log_ingest`.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
Reference in New Issue
Block a user