Closed brytonsf closed 1 month ago
I suppose I still have this issue, but right now I'm trying to use Sokol directly from Swift. I think it'd still make sense to generate bindings though, because otherwise I'm using a bunch of UnsafePointers in Swift...
Those .c files are not generated but are part of the sokol-odin repository. Basically, before running gen_all.py you need to clone the following respositories into the sokol/bindings
directory, otherwise generation will fail:
Also see the gen_bindings.yml GH Action snippet here:
Alternatively you can simply out-comment the languages you don't need in gen_all.py, in that case the respective subdirectories are not needed:
https://github.com/floooh/sokol/blob/master/bindgen/gen_all.py
Hi. I'm trying to write a binding generator for Swift.
I run
python3 gen_all.py
from within/bindgen
and see the following result/logs/error:So,
sokol_log.c
doesn't seem to exist.sokol_log.h
does get created. This seems to make sense, it seems the following things happen:sokol_log.h
gets created via[lang-specific bindgen e.g. rust/odin].gen(...)
gen_ir.gen(...)
is called w/ an expected.c
fileBut in between steps 1 and 2, it doesn't seem like this
.c
file is generated! So this behavior makes sense. But in more global/holistic context, it doesn't make sense, I'd assumepython3 gen_all.py
should just work, and that these.c
files should exist or be generated in the python script somehow. I am not sure what I'm missing here. I'm pretty C-ignorant, btw.Maybe I should clone sokol-zig, sokol-nim, sokol-rust etc., first? That doesn't make sense to me, since the bindgen should create those things, right? This might be indicated by the bindgen doc, although it's under the
Zig
heading, so it's a bit confusing. I see in the gen bindings workflow that those repos are cloned before running the python bindgen script... But then those gen'd bindings are uploaded as repos? Seems circular, I don't understand.