forked from floooh/sokol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_all.py
48 lines (42 loc) · 1.46 KB
/
gen_all.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os, gen_nim, gen_zig, gen_odin, gen_rust, gen_d
tasks = [
[ '../sokol_log.h', 'slog_', [] ],
[ '../sokol_gfx.h', 'sg_', [] ],
[ '../sokol_app.h', 'sapp_', [] ],
[ '../sokol_glue.h', 'sglue_', ['sg_'] ],
[ '../sokol_time.h', 'stm_', [] ],
[ '../sokol_audio.h', 'saudio_', [] ],
[ '../util/sokol_gl.h', 'sgl_', ['sg_'] ],
[ '../util/sokol_debugtext.h', 'sdtx_', ['sg_'] ],
[ '../util/sokol_shape.h', 'sshape_', ['sg_'] ],
]
# Odin
gen_odin.prepare()
for task in tasks:
[c_header_path, main_prefix, dep_prefixes] = task
gen_odin.gen(c_header_path, main_prefix, dep_prefixes)
# Nim
gen_nim.prepare()
for task in tasks:
[c_header_path, main_prefix, dep_prefixes] = task
gen_nim.gen(c_header_path, main_prefix, dep_prefixes)
# Zig
zig_tasks = [
*tasks,
[ '../sokol_fetch.h', 'sfetch_', [] ],
[ '../util/sokol_imgui.h', 'simgui_', ['sg_', 'sapp_'] ],
]
gen_zig.prepare()
for task in zig_tasks:
[c_header_path, main_prefix, dep_prefixes] = task
gen_zig.gen(c_header_path, main_prefix, dep_prefixes)
# D
gen_d.prepare()
for task in tasks:
[c_header_path, main_prefix, dep_prefixes] = task
gen_d.gen(c_header_path, main_prefix, dep_prefixes)
# Rust
gen_rust.prepare()
for task in tasks:
[c_header_path, main_prefix, dep_prefixes] = task
gen_rust.gen(c_header_path, main_prefix, dep_prefixes)