gtk-rs / gir

Tool to generate rust bindings and user API for glib-based libraries
https://gtk-rs.org/gir/book/
MIT License
232 stars 105 forks source link

Allow for separate Gir and Library names #1550

Open chrisduerr opened 7 months ago

chrisduerr commented 7 months ago

So this is partially just a question to understand if I'm doing something wrong, but I think there might be an opportunity for enhancement in gir itself.

I'm currently in the process of generating bindings for WPEWebKit-1.1 and one of its dependencies is WPEJavaScriptCore. However the unusual thing is that the Gir file is WPEJavaScriptCore-1.1.gir while it uses the same library as WPE-Webkit-1.1, just with different headers.

I got this to work by using library = "WPEJavaScriptCore" and then editing the Cargo.toml and tests/abi.rs to use the webkit system library, but it might be nice if there was something like name for the gir file so I could specify library and gir file separately?

I've checked my WPEWebKit bindings and that definitely doesn't automatically generate WPEJavaScriptCore binding with it, so I'd assume library is used to find the corresponding gir and generate headers from there.

This is only a problem with the -sys crates.