diff options
| author | Karl Zylinski <karl@zylinski.se> | 2025-01-26 00:39:38 +0100 |
|---|---|---|
| committer | Karl Zylinski <karl@zylinski.se> | 2025-01-26 00:56:39 +0100 |
| commit | 926a41e417adb39083841c6de6f135217456e34c (patch) | |
| tree | b104c0bf0db9338632cb84cc0c0eeea17e7a3ec5 /bindgen | |
| parent | db9ebdf24243572c190affde269b92725942ddd0 (diff) | |
Generate Odin bindings that: (1) Are easier to use with web builds. (2) Compile cleanly with '-vet -strict-style'
Diffstat (limited to 'bindgen')
| -rw-r--r-- | bindgen/gen_odin.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bindgen/gen_odin.py b/bindgen/gen_odin.py index 42d58705..1d9bf82a 100644 --- a/bindgen/gen_odin.py +++ b/bindgen/gen_odin.py @@ -360,6 +360,8 @@ def gen_c_imports(inp, c_prefix, prefix): linux_gl_libs = get_system_libs(prefix, 'linux', 'gl') l( 'import "core:c"') l( '') + l( '_ :: c') + l( '') l( 'SOKOL_DEBUG :: #config(SOKOL_DEBUG, ODIN_DEBUG)') l( '') l(f'DEBUG :: #config(SOKOL_{module_name.upper()}_DEBUG, SOKOL_DEBUG)') @@ -421,6 +423,9 @@ def gen_c_imports(inp, c_prefix, prefix): l(f' when DEBUG {{ foreign import {clib_import} {{ "{clib_prefix}_linux_x64_gl_debug.a"{linux_gl_libs} }} }}') l(f' else {{ foreign import {clib_import} {{ "{clib_prefix}_linux_x64_gl_release.a"{linux_gl_libs} }} }}') l( ' }') + l( '} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {') + l(f' // Feed {clib_prefix}_wasm_gl_debug.a or {clib_prefix}_wasm_gl_release.a into emscripten compiler.') + l(f' foreign import {clib_import} {{ "env.o" }}') l( '} else {') l( ' #panic("This OS is currently not supported")') l( '}') |