Skip to content

Commit 439ef26

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Test Pyodide builds
1 parent 46414cb commit 439ef26

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

build_sdl.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
# The SDL version to include in binary distributions.
3838
SDL_BUNDLE_VERSION = os.environ.get("SDL_VERSION", "3.2.16")
3939

40-
4140
# Used to remove excessive newlines in debug outputs.
4241
RE_NEWLINES = re.compile(r"\n\n+")
4342
# Functions using va_list need to be culled.
@@ -124,6 +123,8 @@
124123
)
125124
)
126125

126+
CMAKE_FIND_SDL_CMD = ("cmake", "--find-package", "-D", "NAME=SDL3", "-D", "COMPILER_ID=GNU", "-D", "LANGUAGE=C")
127+
127128

128129
def check_sdl_version() -> None:
129130
"""Check the local SDL3 version on Linux distributions."""
@@ -287,7 +288,8 @@ def get_emscripten_include_dir() -> Path:
287288
else: # Unix
288289
matches = re.findall(
289290
r"-I(\S+)",
290-
subprocess.check_output(["pkg-config", "sdl3", "--cflags"], universal_newlines=True),
291+
# subprocess.check_output(["pkg-config", "sdl3", "--cflags"], universal_newlines=True),
292+
subprocess.check_output((*CMAKE_FIND_SDL_CMD, "-D", "MODE=COMPILE"), text=True),
291293
)
292294
assert matches
293295

@@ -406,9 +408,10 @@ def get_cdef() -> tuple[str, dict[str, str]]:
406408
if "PYODIDE" in os.environ:
407409
extra_compile_args += ["--use-port=sdl3"]
408410
extra_link_args += ["--use-port=sdl3"]
409-
cmake_cmd = ("cmake", "--find-package", "-D", "NAME=SDL3", "-D", "COMPILER_ID=GNU", "-D", "LANGUAGE=C")
410-
extra_compile_args += subprocess.check_output((*cmake_cmd, "-D", "MODE=COMPILE"), text=True).strip().split()
411-
extra_link_args += subprocess.check_output((*cmake_cmd, "-D", "MODE=LINK"), text=True).strip().split()
411+
extra_compile_args += (
412+
subprocess.check_output((*CMAKE_FIND_SDL_CMD, "-D", "MODE=COMPILE"), text=True).strip().split()
413+
)
414+
extra_link_args += subprocess.check_output((*CMAKE_FIND_SDL_CMD, "-D", "MODE=LINK"), text=True).strip().split()
412415
print(f"{extra_compile_args=}")
413416
print(f"{extra_link_args=}")
414417
elif sys.platform not in ["win32", "darwin"]:

0 commit comments

Comments
 (0)