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.
This PR adds two new features:
static
andruntime
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 thestatic
feature is enabled, bindgen will linklibclang
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.