Skip to content

Commit 409548d

Browse files
committed
Test Pyodide builds
Simple import test
1 parent 32553fc commit 409548d

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ jobs:
339339
env:
340340
CIBW_BUILD: cp313-pyodide_wasm32
341341
CIBW_PLATFORM: pyodide
342+
CIBW_TEST_COMMAND: python -c "import tcod.context"
342343
- name: Archive wheel
343344
uses: actions/upload-artifact@v4
344345
with:

build_sdl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def get_cdef() -> tuple[str, dict[str, str]]:
370370
library_dirs: list[str] = []
371371

372372
if "PYODIDE" in os.environ:
373-
pass
373+
libraries += ["SDL3"]
374374
elif sys.platform == "darwin":
375375
extra_link_args += ["-framework", "SDL3"]
376376
else:
@@ -399,6 +399,7 @@ def get_cdef() -> tuple[str, dict[str, str]]:
399399

400400
if "PYODIDE" in os.environ:
401401
extra_compile_args += ["--use-port=sdl3"]
402+
extra_link_args += ["--use-port=sdl3"]
402403
elif sys.platform not in ["win32", "darwin"]:
403404
# Use sdl-config to link to SDL on Linux.
404405
extra_compile_args += (

tcod/cffi.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@
1717

1818
REQUIRED_SDL_VERSION = (3, 2, 0)
1919

20-
ffi_check = cffi.FFI()
21-
ffi_check.cdef(
22-
"""
23-
int SDL_GetVersion(void);
24-
"""
25-
)
26-
2720

2821
def verify_dependencies() -> None:
2922
"""Try to make sure dependencies exist on this system."""
23+
ffi_check = cffi.FFI()
24+
ffi_check.cdef(
25+
"""
26+
int SDL_GetVersion(void);
27+
"""
28+
)
3029
if sys.platform == "win32":
3130
lib_test: Any = ffi_check.dlopen("SDL3.dll") # Make sure SDL3.dll is here.
3231
int_version = lib_test.SDL_GetVersion() # Need to check this version.

0 commit comments

Comments
 (0)