Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix silicon support #111

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,41 @@ jobs:
- name: Run tests
run: |
xvfb-run -s '-screen 0 1024x768x24' pytest

build_macos:
runs-on: macos-14
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install system packages
run: brew install pkg-config [email protected] libzip capnp cmake

- name: Install python packages
run: python3 -m pip install --upgrade pip pytest

- name: Build project
run: |
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
python3 -m pip install -e .

- name: Run tests
run: |
xvfb-run -s '-screen 0 1024x768x24' pytest

# - name: Build wheel
# run: python3 -m build --wheel --sdist

# - name: Smoke Test
# run: |
# python3 -m pip uninstall stable-retro -y
# python3 -m pip install --no-cache dist/*.whl
# python3 -c 'import retro; env = retro.make("Airstriker-Genesis", render_mode="rgb_array"); env.reset(); print(env.step(env.action_space.sample())); env.close();'

13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()

if(UNIX)
if(APPLE)
set(PYEXT_SUFFIX
".so"
".dylib"
CACHE STRING "Suffix for Python extension modules")
set(DYNLIB_SUFFIX
".so"
".dylib"
CACHE STRING "Suffix for dynamic libraries")
elseif(APPLE)
elseif(UNIX)
set(PYEXT_SUFFIX
".so"
CACHE STRING "Suffix for Python extension modules")
set(DYNLIB_SUFFIX
".dylib"
".so"
CACHE STRING "Suffix for dynamic libraries")
elseif(WIN32)
set(PYEXT_SUFFIX
Expand Down Expand Up @@ -234,7 +234,7 @@ add_core(nes fceumm)
add_core(atari2600 stella)

if(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
message(warning "Detected Apple Silicon, skipping gambatte (gb)")
message(WARNING "Detected Apple Silicon, skipping gambatte (gb)")
else()
add_core(gb gambatte)
endif()
Expand All @@ -244,6 +244,7 @@ add_core(pce mednafen_pce_fast)
add_core(32x picodrive)
add_core(saturn mednafen_saturn)


set(CLEAN_CORES)

foreach(core IN LISTS CORE_TARGETS)
Expand Down
Loading