diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000..925b91c --- /dev/null +++ b/Cross.toml @@ -0,0 +1,2 @@ +[target.x86_64-unknown-linux-gnu] +image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main" diff --git a/README.md b/README.md index 86e8574..c0ae8ad 100644 --- a/README.md +++ b/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