|
37 | 37 | # The SDL version to include in binary distributions.
|
38 | 38 | SDL_BUNDLE_VERSION = os.environ.get("SDL_VERSION", "3.2.16")
|
39 | 39 |
|
40 |
| - |
41 | 40 | # Used to remove excessive newlines in debug outputs.
|
42 | 41 | RE_NEWLINES = re.compile(r"\n\n+")
|
43 | 42 | # Functions using va_list need to be culled.
|
|
124 | 123 | )
|
125 | 124 | )
|
126 | 125 |
|
| 126 | +CMAKE_FIND_SDL_CMD = ("cmake", "--find-package", "-D", "NAME=SDL3", "-D", "COMPILER_ID=GNU", "-D", "LANGUAGE=C") |
| 127 | + |
127 | 128 |
|
128 | 129 | def check_sdl_version() -> None:
|
129 | 130 | """Check the local SDL3 version on Linux distributions."""
|
@@ -287,7 +288,8 @@ def get_emscripten_include_dir() -> Path:
|
287 | 288 | else: # Unix
|
288 | 289 | matches = re.findall(
|
289 | 290 | 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), |
291 | 293 | )
|
292 | 294 | assert matches
|
293 | 295 |
|
@@ -406,9 +408,10 @@ def get_cdef() -> tuple[str, dict[str, str]]:
|
406 | 408 | if "PYODIDE" in os.environ:
|
407 | 409 | extra_compile_args += ["--use-port=sdl3"]
|
408 | 410 | 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() |
412 | 415 | print(f"{extra_compile_args=}")
|
413 | 416 | print(f"{extra_link_args=}")
|
414 | 417 | elif sys.platform not in ["win32", "darwin"]:
|
|
0 commit comments