@@ -265,6 +265,12 @@ def get_emscripten_include_dir() -> Path:
265
265
raise AssertionError (os .environ ["PATH" ])
266
266
267
267
268
+ if "PYODIDE" in os .environ :
269
+ with TemporaryDirectory () as tmp_dir :
270
+ blank_source = Path (tmp_dir , "blank.c" )
271
+ blank_source .write_text ("" )
272
+ subprocess .run (["emcc" , "--use-port=sdl3" , blank_source ], check = True )
273
+
268
274
check_sdl_version ()
269
275
270
276
SDL_PARSE_PATH : Path | None = None
@@ -398,12 +404,7 @@ def get_cdef() -> tuple[str, dict[str, str]]:
398
404
extra_link_args += ["-rpath" , "/usr/local/opt/llvm/lib/" ]
399
405
400
406
if "PYODIDE" in os .environ :
401
- with TemporaryDirectory () as tmp_dir :
402
- blank_source = Path (tmp_dir , "blank.c" )
403
- blank_source .write_text ("" )
404
- print (f"""EMCC CFLAGS: { subprocess .check_output (["emcc" , "--use-port=sdl3" , "--cflags" ], text = True )!r} """ )
405
- subprocess .run (["emcc" , "--use-port=sdl3" , blank_source ], check = True )
406
-
407
+ print (f"""EMCC CFLAGS: { subprocess .check_output (["emcc" , "--use-port=sdl3" , "--cflags" ], text = True )!r} """ )
407
408
extra_compile_args += ["--use-port=sdl3" ]
408
409
extra_link_args += ["--use-port=sdl3" ]
409
410
cmake_cmd = ("cmake" , "--find-package" , "-D" , "NAME=SDL3" , "-D" , "COMPILER_ID=GNU" , "-D" , "LANGUAGE=C" )
0 commit comments