Skip to content

Commit c16ca1c

Browse files
committed
fixup! fixup! fixup! fixup! Test Pyodide builds
1 parent 37a9bb9 commit c16ca1c

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

build_sdl.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -293,25 +293,24 @@ def get_emscripten_include_dir() -> Path:
293293
elif sys.platform == "darwin" and SDL_PARSE_PATH is not None:
294294
SDL_INCLUDE = SDL_PARSE_PATH / "Versions/A/Headers"
295295
else: # Unix
296+
matches = []
296297
try:
297298
out = subprocess.check_output(["pkg-config", "sdl3", "--cflags"], universal_newlines=True)
298299
except Exception:
299300
if "PYODIDE" in os.environ:
300301
emcc_stdout = subprocess.check_output(["emcc", "--use-port=sdl3", "--cflags"], text=True)
301302
print(f"""EMCC CFLAGS: {emcc_stdout}""")
302-
subprocess.run(
303-
("find", "/home/runner/.cache/cibuildwheel/emsdk-4.0.9/emsdk-4.0.9/upstream/emscripten/cache/sysroot"),
304-
check=False,
303+
matches = re.findall(r"--sysroot=(\S+)", emcc_stdout)
304+
else:
305+
cmake_out = subprocess.run(
306+
(*CMAKE_FIND_SDL_CMD, "-D", "MODE=COMPILE"), check=False, text=True, stdout=subprocess.PIPE
305307
)
306-
307-
cmake_out = subprocess.run(
308-
(*CMAKE_FIND_SDL_CMD, "-D", "MODE=COMPILE"), check=False, text=True, stdout=subprocess.PIPE
309-
)
310-
print(f"{cmake_out.stdout=}")
311-
cmake_out.check_returncode()
308+
print(f"{cmake_out.stdout=}")
309+
cmake_out.check_returncode()
312310

313311
out = subprocess.check_output((*CMAKE_FIND_SDL_CMD, "-D", "MODE=COMPILE"), text=True)
314-
matches = re.findall(r"-I(\S+)", out)
312+
if not matches:
313+
matches = re.findall(r"-I(\S+)", out)
315314
if not matches:
316315
matches = ["/usr/include"]
317316

0 commit comments

Comments
 (0)