Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Nazariglez/sokol into Naz…
Browse files Browse the repository at this point in the history
…ariglez-master
  • Loading branch information
floooh committed Jul 30, 2024
2 parents 547f455 + c16a2d2 commit 702e088
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions bindgen/gen_nim.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,27 +489,40 @@ def gen_imports(inp, dep_prefixes):
def gen_extra(inp):
if inp['prefix'] in ['sg_']:
# FIXME: remove when sokol-shdc has been integrated!
l('when defined gl:')
l('when defined emscripten:')
l(' const gl* = true')
l(' const d3d11* = false')
l(' const metal* = false')
l(' const emscripten* = true')
l('elif when defined gl:')
l(' const gl* = true')
l(' const d3d11* = false')
l(' const metal* = false')
l(' const emscripten* = false')
l('elif defined windows:')
l(' const gl* = false')
l(' const d3d11* = true')
l(' const metal* = false')
l(' const emscripten* = false')
l('elif defined macosx:')
l(' const gl* = false')
l(' const d3d11* = false')
l(' const metal* = true')
l(' const emscripten* = false')
l('elif defined linux:')
l(' const gl* = true')
l(' const d3d11* = false')
l(' const metal* = false')
l(' const emscripten* = false')
l('else:')
l(' error("unsupported platform")')
l('')
if inp['prefix'] in ['sg_', 'sapp_']:
l('when defined windows:')
l('when defined emscripten:')
l(' {.passl:"-lGL -ldl".}')
l(' {.passc:"-DSOKOL_GLES3".}')
l(' {.passL: "-s USE_WEBGL2=1".}')
l('elif defined windows:')
l(' when not defined vcc:')
l(' {.passl:"-lkernel32 -luser32 -lshell32 -lgdi32".}')
l(' when defined gl:')
Expand Down Expand Up @@ -540,7 +553,8 @@ def gen_extra(inp):
l('elif defined macosx:')
l(' {.passl:"-framework AudioToolbox".}')
l('elif defined linux:')
l(' {.passl:"-lasound -lm -lpthread".}')
l(' when not defined emscripten:')
l(' {.passl:"-lasound -lm -lpthread".}')
l('else:')
l(' error("unsupported platform")')
l('')
Expand Down

0 comments on commit 702e088

Please sign in to comment.