@@ -265,6 +265,12 @@ def get_emscripten_include_dir() -> Path:
265265 raise AssertionError (os .environ ["PATH" ])
266266
267267
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+
268274check_sdl_version ()
269275
270276SDL_PARSE_PATH : Path | None = None
@@ -398,12 +404,7 @@ def get_cdef() -> tuple[str, dict[str, str]]:
398404 extra_link_args += ["-rpath" , "/usr/local/opt/llvm/lib/" ]
399405
400406if "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} """ )
407408 extra_compile_args += ["--use-port=sdl3" ]
408409 extra_link_args += ["--use-port=sdl3" ]
409410 cmake_cmd = ("cmake" , "--find-package" , "-D" , "NAME=SDL3" , "-D" , "COMPILER_ID=GNU" , "-D" , "LANGUAGE=C" )
0 commit comments