diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 468e258..c359c7e 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -29,7 +29,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 @@ -40,10 +40,18 @@ jobs: with: platforms: arm64 + # See https://docs.scipy.org/doc/scipy/building/index.html + - name: Install MinGW + if: runner.os == 'Windows' + run: | + choco install rtools -y --no-progress --force --version=4.0.0.20220206 + echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH + - name: Build wheels uses: pypa/cibuildwheel@v2.16 env: CIBW_ARCHS_LINUX: auto aarch64 + CIBW_ARCHS_WINDOWS: AMD64 CIBW_ENVIRONMENT_MACOS: FC=gfortran-11 # Skip musllinux wheels, which take a long time to build because Numpy must be built from source # Skip PyPy wheels diff --git a/meson.build b/meson.build index 9507b1f..0af56cf 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,11 @@ add_global_arguments( add_languages('fortran') +is_windows = host_machine.system() == 'windows' +if is_windows + add_project_link_arguments('-lquadmath', language : 'c') +endif + py_mod = import('python') py = py_mod.find_installation(pure: false) diff --git a/pyproject.toml b/pyproject.toml index 1c76555..ffa1fd1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,3 +40,7 @@ test = ["pytest-doctestplus"] [tool.cibuildwheel] test-extras = ["test"] test-command = "pytest --pyargs radbelt --doctest-plus" + +[tool.cibuildwheel.windows] +before-build = "pip install delvewheel" +repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"