@@ -273,6 +273,14 @@ def get_emscripten_include_dir() -> Path:
273273 raise AssertionError (os .environ ["PATH" ])
274274
275275
276+ include_dirs : list [str ] = []
277+ extra_compile_args : list [str ] = []
278+ extra_link_args : list [str ] = []
279+
280+ libraries : list [str ] = []
281+ library_dirs : list [str ] = []
282+
283+
276284if "PYODIDE" in os .environ :
277285 with TemporaryDirectory () as tmp_dir :
278286 blank_source = Path (tmp_dir , "blank.c" )
@@ -302,7 +310,9 @@ def get_emscripten_include_dir() -> Path:
302310 print (f"""EMCC CFLAGS: { emcc_stdout } """ )
303311 matches = re .findall (r"--sysroot=(\S+)" , emcc_stdout )
304312 print (f"{ matches = } " )
305- matches = [str (Path (matches [0 ], "include" ))]
313+ (sysroot ,) = matches
314+ matches = [str (Path (sysroot , "include" ))]
315+ library_dirs .append (str (Path (sysroot , "lib" )))
306316 out = ""
307317 else :
308318 cmake_out = subprocess .run (
@@ -399,13 +409,6 @@ def get_cdef() -> tuple[str, dict[str, str]]:
399409 return sdl_cdef + EXTRA_CDEF , parser .known_string_defines
400410
401411
402- include_dirs : list [str ] = []
403- extra_compile_args : list [str ] = []
404- extra_link_args : list [str ] = []
405-
406- libraries : list [str ] = []
407- library_dirs : list [str ] = []
408-
409412if "PYODIDE" in os .environ :
410413 libraries += ["SDL3" ]
411414elif sys .platform == "darwin" :
0 commit comments