aboutsummaryrefslogtreecommitdiff
path: root/bindgen
diff options
context:
space:
mode:
authorMatheus Catarino <matheus-catarino@hotmail.com>2025-07-05 10:10:18 -0300
committerMatheus Catarino <matheus-catarino@hotmail.com>2025-07-05 10:10:18 -0300
commitad15fcd5c28acae9e97061d510a5d87dba8c692b (patch)
tree872051833c33cf7f4f617a3ef4e6144d488f8b24 /bindgen
parenta6cb14c1c804346287060a38d1f7c361095da1a8 (diff)
nuklear checker added
Diffstat (limited to 'bindgen')
-rw-r--r--bindgen/gen_all.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/bindgen/gen_all.py b/bindgen/gen_all.py
index 42ce9626..e1b946a7 100644
--- a/bindgen/gen_all.py
+++ b/bindgen/gen_all.py
@@ -1,4 +1,4 @@
-import os, argparse, gen_nim, gen_zig, gen_odin, gen_rust, gen_d, gen_jai, gen_c3
+import os, argparse, gen_nim, gen_zig, gen_odin, gen_rust, gen_d, gen_jai, gen_c3, shutil
parser = argparse.ArgumentParser()
parser.add_argument("--zig-tiger-style", action="store_true", help="Enable zig tiger style mode.")
@@ -52,12 +52,20 @@ d_tasks = [
[ '../sokol_fetch.h', 'sfetch_', [] ],
[ '../util/sokol_memtrack.h', 'smemtrack_', [] ],
[ '../util/sokol_imgui.h', 'simgui_', ['sg_', 'sapp_'] ],
- [ '../util/sokol_nuklear.h', 'snk_', ['sg_', 'sapp_'] ],
]
+# check if nuklear.h is available and copy it
+if os.path.exists('../tests/ext/nuklear.h'):
+ d_tasks.append([ '../util/sokol_nuklear.h', 'snk_', ['sg_', 'sapp_'] ])
+ if os.path.exists('sokol-d'):
+ os.makedirs('sokol-d/src/sokol/c', exist_ok=True)
+ shutil.copy('../tests/ext/nuklear.h', 'sokol-d/src/sokol/c/nuklear.h')
gen_d.prepare()
for task in d_tasks:
[c_header_path, main_prefix, dep_prefixes] = task
gen_d.gen(c_header_path, main_prefix, dep_prefixes)
+# drop nuklear.h if copied (after generated D files)
+if os.path.exists('sokol-d/src/sokol/c/nuklear.h'):
+ os.remove('sokol-d/src/sokol/c/nuklear.h')
# Rust
gen_rust.prepare()
@@ -69,4 +77,4 @@ for task in tasks:
gen_c3.prepare()
for task in tasks:
[c_header_path, main_prefix, dep_prefixes] = task
- gen_c3.gen(c_header_path, main_prefix, dep_prefixes)
+ gen_c3.gen(c_header_path, main_prefix, dep_prefixes) \ No newline at end of file