标签 Cargo 下的文章

大家好,我构建了一套交叉编译工具链,支持在 Windows 、macOS 或 Linux 上为其他平台构建二进制文件,且无需 WSL 、Docker 或 Colima 。

例如,你可以在 Windows 机器上构建可在 Linux 上运行的可执行程序。

用法很简单:

cargo install cargo-cross
cargo cross build --target x86_64-unknown-linux-musl
cargo cross build --target x86_64-unknown-linux-glibc --glibc-version 2.42
cargo cross build --target x86_64-pc-windows-gnu

支持:

windows 构建到 windows/linux/freebsd/android

linux 构建到 windows/linux/macos/ios/freebsd/android

macos 构建到 windows/linux/macos/ios/freebsd/android

你还可以选择使用的是 glibc 还是 musl libc ,甚至可以选择 glibc 版本(支持 2.28-2.42 )

项目地址: https://github.com/zijiren233/cargo-cross

求 star