diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index cbd44b4a..0fa917b4 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -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 lua@5.1 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();' + diff --git a/CMakeLists.txt b/CMakeLists.txt index afd086e8..93925566 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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() @@ -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)