Open aiverson opened 5 years ago
There's one here https://github.com/luapower/terra-low (the function is called publish
) and is used here https://github.com/luapower/terra-layer (look at the very end of the layer.t
, the generated header is layerlib_h
). It not only generates C-defs but also ffi.metatype declarations so you can consume the library from LuaJIT directly with methods. You could strip that part out and only keep the cdefs (actually that function also does the building and linking, strip that out too).
Is there a function to write out a C header file that can be #included in a C program so that a library written in terra can be linked to from c without needing to manually write a c header file?
Or do I need to write it myself?