pub fn emit_version_cfg(nix_version: &str, relevant_versions: &[&str])Expand description
Emit cargo:rustc-cfg directives for Nix version-based conditional compilation.
Call from build.rs with the Nix version and desired version gates.
ยงExample
use nix_bindings_util::nix_version::emit_version_cfg;
let nix_version = pkg_config::probe_library("nix-store-c").unwrap().version;
emit_version_cfg(&nix_version, &["2.26", "2.33.0pre", "2.33"]);Emits nix_at_least="2.26" and nix_at_least="2.33.0pre" for version 2.33.0pre,
usable as #[cfg(nix_at_least = "2.26")].