Skip to content

Commit 0b4922e

Browse files
committed
fixup! fixup! fixup! Test Pyodide builds
1 parent a1017e5 commit 0b4922e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build_sdl.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,19 @@ def get_cdef() -> tuple[str, dict[str, str]]:
398398
extra_link_args += ["-rpath", "/usr/local/opt/llvm/lib/"]
399399

400400
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+
subprocess.check_output(["emcc", "--use-port=sdl3", blank_source], universal_newlines=True)
405+
401406
extra_compile_args += ["--use-port=sdl3"]
402407
extra_link_args += ["--use-port=sdl3"]
408+
extra_compile_args += (
409+
subprocess.check_output(["pkg-config", "sdl3", "--cflags"], universal_newlines=True).strip().split()
410+
)
411+
extra_link_args += (
412+
subprocess.check_output(["pkg-config", "sdl3", "--libs"], universal_newlines=True).strip().split()
413+
)
403414
elif sys.platform not in ["win32", "darwin"]:
404415
# Use sdl-config to link to SDL on Linux.
405416
extra_compile_args += (

0 commit comments

Comments
 (0)