@@ -262,12 +262,12 @@ def on_directive_handle(
262262SDL_INCLUDE : Path
263263if "PYODIDE" in os .environ :
264264 # None of the EMSDK environment variables exist! Search PATH for Emscripten as a workaround
265- for path in os .environ ["PATH" ].split (os .pathsep ):
265+ for path in os .environ ["PATH" ].split (os .pathsep )[:: - 1 ] :
266266 if Path (path ).match ("upstream/emscripten" ):
267267 SDL_INCLUDE = Path (path )
268268 break
269269 else :
270- raise AssertionError
270+ raise AssertionError ( os . environ [ "PATH" ])
271271elif sys .platform == "win32" and SDL_PARSE_PATH is not None :
272272 SDL_INCLUDE = SDL_PARSE_PATH / "include"
273273elif sys .platform == "darwin" and SDL_PARSE_PATH is not None :
@@ -392,11 +392,10 @@ def get_cdef() -> tuple[str, dict[str, str]]:
392392 extra_link_args += ["-rpath" , "/usr/local/opt/llvm/lib/" ]
393393
394394# Use sdl-config to link to SDL on Linux.
395- if sys .platform not in ["win32" , "darwin" ]:
395+ if sys .platform not in ["win32" , "darwin" ] and "PYODIDE" not in os . environ :
396396 extra_compile_args += (
397397 subprocess .check_output (["pkg-config" , "sdl3" , "--cflags" ], universal_newlines = True ).strip ().split ()
398398 )
399- if "PYODIDE" not in os .environ :
400- extra_link_args += (
401- subprocess .check_output (["pkg-config" , "sdl3" , "--libs" ], universal_newlines = True ).strip ().split ()
402- )
399+ extra_link_args += (
400+ subprocess .check_output (["pkg-config" , "sdl3" , "--libs" ], universal_newlines = True ).strip ().split ()
401+ )
0 commit comments