aboutsummaryrefslogtreecommitdiff
path: root/bindgen
diff options
context:
space:
mode:
authorBarna Mumtyan <barnamumtyan@gmail.com>2024-05-04 16:01:39 +0300
committerBarna Mumtyan <barnamumtyan@gmail.com>2024-05-04 16:01:39 +0300
commitd06038a40993ac285ca061b10791c17df08ceb78 (patch)
tree901fc8727e7e20551ac9478499dfaa19cab5294f /bindgen
parent4483275d3b0be2c5ac23d8054bc66d3cb4ff75ec (diff)
Added support for generating dynamic libraries for macos in sokol-odin port.
Diffstat (limited to 'bindgen')
-rw-r--r--bindgen/gen_odin.py37
1 files changed, 24 insertions, 13 deletions
diff --git a/bindgen/gen_odin.py b/bindgen/gen_odin.py
index dc1a2c37..31638fd6 100644
--- a/bindgen/gen_odin.py
+++ b/bindgen/gen_odin.py
@@ -372,21 +372,32 @@ def gen_c_imports(inp, c_prefix, prefix):
l( ' }')
l( ' }')
l( '} else when ODIN_OS == .Darwin {')
- l( ' when USE_GL {')
- l( ' when ODIN_ARCH == .arm64 {')
- l(f' when DEBUG {{ foreign import {clib_import} {{ "{clib_prefix}_macos_arm64_gl_debug.a"{macos_gl_libs} }} }}')
- l(f' else {{ foreign import {clib_import} {{ "{clib_prefix}_macos_arm64_gl_release.a"{macos_gl_libs} }} }}')
- l( ' } else {')
- l(f' when DEBUG {{ foreign import {clib_import} {{ "{clib_prefix}_macos_x64_gl_debug.a"{macos_gl_libs} }} }}')
- l(f' else {{ foreign import {clib_import} {{ "{clib_prefix}_macos_x64_gl_release.a"{macos_gl_libs} }} }}')
- l( ' }')
+ l( ' when USE_DLL {')
+ l(f' when USE_GL && ODIN_ARCH == .arm64 && DEBUG {{ foreign import {clib_import} {{ "../dylib/sokol_dylib_macos_arm64_gl_debug.dylib" }} }}')
+ l(f' else when USE_GL && ODIN_ARCH == .arm64 && !DEBUG {{ foreign import {clib_import} {{ "../dylib/sokol_dylib_macos_arm64_gl_release.dylib" }} }}')
+ l(f' else when USE_GL && ODIN_ARCH == .amd64 && DEBUG {{ foreign import {clib_import} {{ "../dylib/sokol_dylib_macos_x64_gl_debug.dylib" }} }}')
+ l(f' else when USE_GL && ODIN_ARCH == .amd64 && !DEBUG {{ foreign import {clib_import} {{ "../dylib/sokol_dylib_macos_x64_gl_release.dylib" }} }}')
+ l(f' else when !USE_GL && ODIN_ARCH == .arm64 && DEBUG {{ foreign import {clib_import} {{ "../dylib/sokol_dylib_macos_arm64_metal_debug.dylib" }} }}')
+ l(f' else when !USE_GL && ODIN_ARCH == .arm64 && !DEBUG {{ foreign import {clib_import} {{ "../dylib/sokol_dylib_macos_arm64_metal_release.dylib" }} }}')
+ l(f' else when !USE_GL && ODIN_ARCH == .amd64 && DEBUG {{ foreign import {clib_import} {{ "../dylib/sokol_dylib_macos_x64_metal_debug.dylib" }} }}')
+ l(f' else when !USE_GL && ODIN_ARCH == .amd64 && !DEBUG {{ foreign import {clib_import} {{ "../dylib/sokol_dylib_macos_x64_metal_release.dylib" }} }}')
l( ' } else {')
- l( ' when ODIN_ARCH == .arm64 {')
- l(f' when DEBUG {{ foreign import {clib_import} {{ "{clib_prefix}_macos_arm64_metal_debug.a"{macos_metal_libs} }} }}')
- l(f' else {{ foreign import {clib_import} {{ "{clib_prefix}_macos_arm64_metal_release.a"{macos_metal_libs} }} }}')
+ l( ' when USE_GL {')
+ l( ' when ODIN_ARCH == .arm64 {')
+ l(f' when DEBUG {{ foreign import {clib_import} {{ "{clib_prefix}_macos_arm64_gl_debug.a"{macos_gl_libs} }} }}')
+ l(f' else {{ foreign import {clib_import} {{ "{clib_prefix}_macos_arm64_gl_release.a"{macos_gl_libs} }} }}')
+ l( ' } else {')
+ l(f' when DEBUG {{ foreign import {clib_import} {{ "{clib_prefix}_macos_x64_gl_debug.a"{macos_gl_libs} }} }}')
+ l(f' else {{ foreign import {clib_import} {{ "{clib_prefix}_macos_x64_gl_release.a"{macos_gl_libs} }} }}')
+ l( ' }')
l( ' } else {')
- l(f' when DEBUG {{ foreign import {clib_import} {{ "{clib_prefix}_macos_x64_metal_debug.a"{macos_metal_libs} }} }}')
- l(f' else {{ foreign import {clib_import} {{ "{clib_prefix}_macos_x64_metal_release.a"{macos_metal_libs} }} }}')
+ l( ' when ODIN_ARCH == .arm64 {')
+ l(f' when DEBUG {{ foreign import {clib_import} {{ "{clib_prefix}_macos_arm64_metal_debug.a"{macos_metal_libs} }} }}')
+ l(f' else {{ foreign import {clib_import} {{ "{clib_prefix}_macos_arm64_metal_release.a"{macos_metal_libs} }} }}')
+ l( ' } else {')
+ l(f' when DEBUG {{ foreign import {clib_import} {{ "{clib_prefix}_macos_x64_metal_debug.a"{macos_metal_libs} }} }}')
+ l(f' else {{ foreign import {clib_import} {{ "{clib_prefix}_macos_x64_metal_release.a"{macos_metal_libs} }} }}')
+ l( ' }')
l( ' }')
l( ' }')
l( '} else when ODIN_OS == .Linux {')