One thing I'm missing in the Rust ecosystem of bindings to C libraries is easy conditional compilation based on the build-time library version. Something like the GTK_CHECK_VERSION() macros in C.

In Rust bindings, it's common to expose some baseline version API, then have feature flags to expose (and depend on) newer versions of the library. But there's no simple way to do, as a downstream user:

#[cfg(have_gtk_4_12)]
use_new_api();
#[cfg(not(have_gtk_4_12))]
fallback_with_old_api();

#rust

@YaLTeR can't you just declare a cfg flag of your own that requires an upstream cfg feature? You can also codegen in a build script, although that's quite janky.
@Alonely0 yeah, I imagine you'd need to declare your own cfg flags (one per each version check that you need) and write build system integration that automatically sets them based on the build-time available library. Which is quite far from simple and easy, so nobody (including myself) does it
@YaLTeR fair point. I guess it would be nice to be able to cfg on dep's flags...