raymanfx / libv4l-rs

Video4Linux2 bindings for Rust
MIT License
155 stars 65 forks source link

Add static bindgen linking options #91

Closed callum-hopkins-dev closed 9 months ago

callum-hopkins-dev commented 10 months ago

This PR adds two new features: static and runtime with the latter being enabled by default.

When the runtime feature is enabled, the crate will compile the same as before, since bindgen enables runtime linking by default. However, when the static feature is enabled, bindgen will link libclang and other toolchain infrastructure as static libraries.

Static linking is useful for building projects on musl based linux distributions such as alpine, since they do not support dynamic linking easily. Moreover, static linking is more aligned with rust's general compilation philosophies and this PR gives users the options to enable it.