Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinung-r committed Sep 19, 2022
1 parent 8d8008a commit 044f803
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ on: [push, pull_request]

jobs:
wheels:
name: Build wheels on ${{ matrix.os }}
name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-2016
cibw-arch: AMD64
cmake-generator: "Visual Studio 15 2017 Win64"
- os: windows-2016
cibw-arch: x86
cmake-generator: "Visual Studio 15 2017"
- os: windows-2019
arch: AMD64
cmake-generator: "Visual Studio 16 2019"
cmake_generator_platform: "x64"
- os: windows-2019
arch: x86
cmake-generator: "Visual Studio 16 2019"
cmake_generator_platform: "Win32"
- os: ubuntu-20.04
arch: aarch64
- os: ubuntu-20.04
Expand All @@ -37,14 +39,15 @@ jobs:
name: Set up QEMU

- name: Install cibuildwheel
run: python -m pip install cibuildwheel
run: python -m pip install cibuildwheel==2.3.1

- name: Build wheels
env:
CIBW_ENVIRONMENT_WINDOWS: CMAKE_GENERATOR="${{ matrix.cmake-generator }}"
CIBW_ARCHS_WINDOWS: ${{ matrix.cibw-arch }}
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: x86_64, arm64
CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES=“${{ matrix.arch }}”
CIBW_ENVIRONMENT_WINDOWS: >
CMAKE_GENERATOR="${{ matrix.cmake-generator }}"
CMAKE_GENERATOR_PLATFORM="${{ matrix.cmake_generator_platform }}"
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_SKIP: pp* *-musllinux_* *cp311*
COMSPEC: C:\Program Files\PowerShell\7\pwsh.EXE
run: |
Expand Down
18 changes: 3 additions & 15 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,18 @@ requires = [
]

[tool.cibuildwheel]
# To make sure that the library is built for the right arch (i686, amd64 etc)
# then the host arch is added onto the build dir. This *must* be expanded by
# cibuildwheel since the build host (runner) might be different than the target
# emulated by the docker image. Ideally there would be a variable that holds
# what's currently being compiled, but I've yet to find it.
#
# Since the command is issued through subprocess.run() then it runs on the
# system native shell, which means all sorts of problems if that shell is
# cmd.exe, since it doesn't understand substitution $(). On windows you change
# the default shell by setting COMSPEC to either bash or powershell (or
# something else that understands $()), but there is little to gain from
# running cibuildwheel on a non-CI windows.
before-build = [
before-all = [
"""cmake \
-S . \
-B "cibw-$(python -c \"import os;print(os.getenv('arch'))\")/" \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON=OFF \
-DBUILD_BIN=OFF \
""",
"""cmake \
--build "cibw-$(python -c \"import os;print(os.getenv('arch'))\")/" \
--build build \
--parallel \
--target install \
--config Release \
Expand Down

0 comments on commit 044f803

Please sign in to comment.