From f1a2dd622fa242d44e2ccc39c106add995626a0f Mon Sep 17 00:00:00 2001 From: Arnaud Taffanel Date: Tue, 13 Jan 2026 14:02:55 +0100 Subject: [PATCH] Add configuration to cross-compile with cross --- Cargo.toml | 2 +- Cross.toml | 5 +++++ README.md | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 Cross.toml diff --git a/Cargo.toml b/Cargo.toml index efaaa0b..df69705 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,7 +65,7 @@ rand = "0.9.2" pretty-hex = "0.4.1" terminal_size = "0.4.3" octocrab = "0.48.1" -reqwest = "0.12.24" +reqwest = { version="0.12.24", default-features = false, features = ["rustls-tls", "json"]} zip = "6.0.0" byteorder = "1.5.0" hex = "0.4.3" diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000..98edef7 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,5 @@ +[build] +pre-build = [ # Install cross-compilation lib dependencies + "dpkg --add-architecture $CROSS_DEB_ARCH", + "apt-get update && apt-get --assume-yes install libudev-dev:$CROSS_DEB_ARCH" +] diff --git a/README.md b/README.md index 0ffcda9..c7a4d17 100644 --- a/README.md +++ b/README.md @@ -108,3 +108,20 @@ For example: ```text cargo run -- select ``` + +### Cross compilation + +Compilation for linux on other platform is possible using the [cross](https://github.com/cross-rs/cross) tool. + +It requires both `cross` and [`docker` or `podman`] to be installed. + +```bash +# Install podman or docker ... +# To install cross +cargo install cross + +# To compile for ARM64 +cross build --target aarch64-unknown-linux-gnu + +# The resulting executable is now in ./target/aarch64-unknown-linux-gnu/debug/cfcli +``` \ No newline at end of file