Skip to content

Commit

Permalink
add emscripten support
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbachmann authored Dec 17, 2024
1 parent e0f86a4 commit bead365
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/releasebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,41 @@ jobs:
name: artifact-${{ github.job }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_wheels_pyodide:
name: Build wheels on ubuntu-latest/pyodide
needs: [build_sdist]
runs-on: ubuntu-latest
env:
CIBW_TEST_REQUIRES: pytest hypothesis
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_PLATFORM: pyodide
CIBW_BUILD_VERBOSITY: 3

steps:
- uses: actions/download-artifact@v4
with:
name: artifact-sdist
path: dist

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Copy wheel
run: cp dist/*.tar.gz rapidfuzz.tar.gz

- name: Build wheel
uses: pypa/[email protected]
with:
package-dir: rapidfuzz.tar.gz
output-dir: wheelhouse

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: pyodide-wheel
path: ./wheelhouse/*.whl

deploy-wheels:
if: github.event_name == 'release' && github.event.action == 'published'
needs: [build_wheels_windows, build_wheels_macos, build_wheels_linux, build_sdist]
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ else()
add_compile_options(-Wall -Wextra -pedantic -Wno-psabi)
endif()

if(EMSCRIPTEN)
add_compile_options(-fexceptions)
add_link_options(-fexceptions)
endif()

if(CMAKE_VERSION VERSION_LESS 3.18)
find_package(
Python
Expand Down

0 comments on commit bead365

Please sign in to comment.