I recently resurrected a project for automatically generating bindings from C to Lua: inclua (https://github.com/gilzoide/inclua).
It is currently able to generate LuaJIT FFI bindings directly from C header files using clang. Generated Lua code defines metatypes with automatically deduced __gc metamethod and other methods in the __index table, but supports adding extra definitions from a YAML or JSON file for metamethods or other fields to be placed in __index.
In the repository examples folder there are two examples with bindings for clang and raylib, and I also made a binding for CSFML. (These bindings are not useful for using with LÖVE, but the binding generator is, you get the idea)
Some things are missing, like generating entries for #defined constants and support for nested anonymous structs|unions, but I think it is quite usable right now. I plan on also supporting generation of pure C/C++ Lua bindings in the future. Haven't tested on Windows or OSX, but it should work just fine with a working installation of python 3 and clang.
I'm happy to help if anyone would like to try and am open for feedbacks and issue reports =D
Automatic FFI binding generation from C headers
Re: Automatic FFI binding generation from C headers
This looks tasty, thanks for sharing.
Who is online
Users browsing this forum: Google [Bot] and 5 guests