cargo-zigbuild-0.4.0 is not a library.
Visit the last successful build:
cargo-zigbuild-0.20.1
cargo-zigbuild
Compile Cargo project with zig as linker for easier cross compiling.
Installation
Usage
- Install zig following the official documentation,
on macOS, Windows and Linux you can also install zig from PyPI via
pip3 install ziglang - Install Rust target via rustup, for example,
rustup target add aarch64-unknown-linux-gnu - Run
cargo zigbuild, for example,cargo zigbuild --target aarch64-unknown-linux-gnu
Specify libc version
cargo zigbuild supports passing libc version in --target option, for example,
to compile for glibc 2.17 with the aarch64-unknown-linux-gnu target:
Limitations
Currently only Linux, macOS and Windows gnu targets are supported, other target platforms can be added if you can make it work, pull requests are welcome.
Known upstream zig issues:
- cross-compiling to macOS with a dependency on iconv: We provide
a bundled version of
libiconv.tbdto zig for linking to make it work.
License
This work is released under the MIT license. A copy of the license is provided in the LICENSE file.