|
@@ -360,6 +360,8 @@ def gen_c_imports(inp, c_prefix, prefix):
|
|
linux_gl_libs = get_system_libs(prefix, 'linux', 'gl')
|
|
linux_gl_libs = get_system_libs(prefix, 'linux', 'gl')
|
|
l( 'import "core:c"')
|
|
l( 'import "core:c"')
|
|
l( '')
|
|
l( '')
|
|
|
|
+ l( '_ :: c')
|
|
|
|
+ l( '')
|
|
l( 'SOKOL_DEBUG :: #config(SOKOL_DEBUG, ODIN_DEBUG)')
|
|
l( 'SOKOL_DEBUG :: #config(SOKOL_DEBUG, ODIN_DEBUG)')
|
|
l( '')
|
|
l( '')
|
|
l(f'DEBUG :: #config(SOKOL_{module_name.upper()}_DEBUG, SOKOL_DEBUG)')
|
|
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' 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(f' else {{ foreign import {clib_import} {{ "{clib_prefix}_linux_x64_gl_release.a"{linux_gl_libs} }} }}')
|
|
l( ' }')
|
|
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( '} else {')
|
|
l( ' #panic("This OS is currently not supported")')
|
|
l( ' #panic("This OS is currently not supported")')
|
|
l( '}')
|
|
l( '}')
|