cbindgen
cbindgen copied to clipboard
Support for custom languages
I wanted to generate bindings for Fortran, but I think this is not possible with the current version of cbindgen
.
I added the CustomLanguage
trait and the corresponding Language::Custom
variant, also exposed some necessary types.
An example usage can be found here.
Hi @LucaCiucci you may wand to take a look at https://github.com/mozilla/cbindgen/pull/853 where I've reworked quite a few things to make the addition of new languages easier.
An example of addtion of a new language is available in https://github.com/mozilla/cbindgen/pull/857 where I add support for java (using the jna lib), the interesting part is here https://github.com/mozilla/cbindgen/blob/d8b3cfae7a197109b4fa1bcf97372db8e7d49f4e/src/bindgen/language_backend/java_jna.rs