Skip to content

Commit 52daac9

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Upgrade to use SDL3 version of libtcod
1 parent cb15ddc commit 52daac9

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

build_sdl.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ def check_sdl_version() -> None:
9090
return
9191
needed_version = f"{SDL_MIN_VERSION[0]}.{SDL_MIN_VERSION[1]}.{SDL_MIN_VERSION[2]}"
9292
try:
93-
sdl_version_str = subprocess.check_output(["sdl3-config", "--version"], universal_newlines=True).strip()
93+
sdl_version_str = subprocess.check_output(
94+
["pkg-config", "sdl3", "--modversion"], universal_newlines=True
95+
).strip()
9496
except FileNotFoundError as exc:
9597
msg = (
9698
"libsdl3-dev or equivalent must be installed on your system and must be at least version"
@@ -219,7 +221,7 @@ def on_directive_handle(
219221
else: # Unix
220222
matches = re.findall(
221223
r"-I(\S+)",
222-
subprocess.check_output(["sdl3-config", "--cflags"], universal_newlines=True),
224+
subprocess.check_output(["pkg-config", "sdl3", "--cflags"], universal_newlines=True),
223225
)
224226
assert matches
225227

@@ -323,5 +325,9 @@ def get_cdef() -> str:
323325

324326
# Use sdl-config to link to SDL on Linux.
325327
if sys.platform not in ["win32", "darwin"]:
326-
extra_compile_args += subprocess.check_output(["sdl3-config", "--cflags"], universal_newlines=True).strip().split()
327-
extra_link_args += subprocess.check_output(["sdl3-config", "--libs"], universal_newlines=True).strip().split()
328+
extra_compile_args += (
329+
subprocess.check_output(["pkg-config", "sdl3", "--cflags"], universal_newlines=True).strip().split()
330+
)
331+
extra_link_args += (
332+
subprocess.check_output(["pkg-config", "sdl3", "--libs"], universal_newlines=True).strip().split()
333+
)

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ def check_sdl_version() -> None:
4242
return
4343
needed_version = "{}.{}.{}".format(*SDL_VERSION_NEEDED)
4444
try:
45-
sdl_version_str = subprocess.check_output(["pkg-config", "sdl3", "--version"], universal_newlines=True).strip() # noqa: S603, S607
45+
sdl_version_str = subprocess.check_output(
46+
["pkg-config", "sdl3", "--modversion"], # noqa: S607
47+
universal_newlines=True,
48+
).strip()
4649
except FileNotFoundError:
4750
try:
4851
sdl_version_str = subprocess.check_output(["sdl3-config", "--version"], universal_newlines=True).strip() # noqa: S603, S607

0 commit comments

Comments
 (0)