|
@@ -1,9 +1,17 @@
|
|
|
import gen_ir, gen_zig
|
|
|
|
|
|
-def gen_bindings(c_header_path, c_prefix, module_name):
|
|
|
- print(f'> {c_header_path}')
|
|
|
- ir = gen_ir.gen_ir(c_header_path, module_name, c_prefix)
|
|
|
- gen_zig.gen_zig(ir)
|
|
|
+tasks = [
|
|
|
+ [ '../sokol_gfx.h', 'sg_', 'gfx' ],
|
|
|
+ [ '../sokol_app.h', 'sapp_', 'app' ]
|
|
|
+]
|
|
|
|
|
|
-gen_bindings('../sokol_gfx.h', 'sg_', 'gfx')
|
|
|
-gen_bindings('../sokol_app.h', 'sapp_', 'app')
|
|
|
+# Zig
|
|
|
+print('> generating Zig bindings...')
|
|
|
+gen_zig.prepare()
|
|
|
+for task in tasks:
|
|
|
+ c_header_path = task[0]
|
|
|
+ c_prefix = task[1]
|
|
|
+ module_name = task[2]
|
|
|
+ print(f' {c_header_path} => {module_name}.zig')
|
|
|
+ ir = gen_ir.gen(c_header_path, module_name, c_prefix)
|
|
|
+ gen_zig.gen(c_header_path, ir)
|