rust-cross / cargo-zigbuild

Compile Cargo project with zig as linker
MIT License
1.45k stars 52 forks source link

Document use with bindgen #144

Closed TheButlah closed 1 year ago

TheButlah commented 1 year ago

I have been trying to get this to work with bindgen for about two days, to no avail. It works with cargo build but not with cargo zigbuild. I suspect this is because cargo zigbuild enforces zig's sysroot, which seemingly lacks stdio.h?

Documenting which specific combination of builder.clang_arg() or environment variables should be provided would be really helpful:

Note: I am attempting to cross compile from a m2 mac to aarch64-unknown-linux-gnu

TheButlah commented 1 year ago

Possibly related, I could just be hitting bugs in zigbuild which might be fixed soon: #140

Either way, documenting this would be super helpful

TheButlah commented 1 year ago

I would not say that this is documented yet

messense commented 1 year ago

Feel free to send PRs to document it.