Skip to content

Commit

Permalink
Build wheels for windows arm64
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Sep 23, 2023
1 parent b4b685e commit 15ee51e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 9 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ jobs:
launchers:
name: launcher
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- msvc-arch: amd64_arm64
cmake-arch: ARM64
artifact: arm64
- msvc-arch: amd64
cmake-arch: x64
artifact: amd64

steps:
- uses: actions/checkout@v4

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
arch: ${{ matrix.msvc-arch }}

- name: Build
shell: bash
Expand All @@ -34,11 +44,14 @@ jobs:
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release
VERBOSE=1 cmake --build .
cmake .. -A "${GENERATOR_PLATFORM}" -DCMAKE_CONFIGURATION_TYPES=Release
VERBOSE=1 cmake --build . --config Release
mv simple_launcher_cli.exe t64.exe
mv simple_launcher_gui.exe w64.exe
mv Release/simple_launcher_cli.exe "t-${REZ_ARTIFACT_NAME}.exe"
mv Release/simple_launcher_gui.exe "w-${REZ_ARTIFACT_NAME}.exe"
env:
GENERATOR_PLATFORM: ${{ matrix.cmake-arch }}
REZ_ARTIFACT_NAME: ${{ matrix.artifact }}

- uses: actions/upload-artifact@v3
with:
Expand All @@ -54,7 +67,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
- os: windows-latest
arch: win_amd64
- os: windows-latest
arch: win_arm64

steps:
- uses: actions/checkout@v4
Expand All @@ -75,6 +93,8 @@ jobs:
set -ex
python -m pip install build
python -m build -w . --outdir ./dist
env:
PYTHON_PLAT_NAME: ${{ matrix.arch }}

- uses: actions/upload-artifact@v3
with:
Expand Down
14 changes: 11 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ def find_files(pattern, path=None, root="rez"):
"""


def _get_platform():
if os.environ.get("PYTHON_PLAT_NAME"):
return os.environ.get("PYTHON_PLAT_NAME")

return get_platform(None)


class rez_build_scripts(build_scripts):
def finalize_options(self):
build_scripts.finalize_options(self)
Expand Down Expand Up @@ -107,9 +114,10 @@ def run(self):
scripts.append(path)

if platform.system() == "Windows":
launcher = "t64.exe"
arch = _get_platform().split("_", 1)[-1]
launcher = f"t-{arch}.exe"
if spec["type"] == "window":
launcher = "w64.exe"
launcher = f"w-{arch}.exe"

self.copy_file(
os.path.join("launcher", launcher),
Expand All @@ -131,7 +139,7 @@ def finalize_options(self):
self.universal = True # Support python 2 and 3
if platform.system() == "Windows":
self.plat_name_supplied = True
self.plat_name = get_platform("")
self.plat_name = _get_platform()

bdist_wheel.finalize_options(self)

Expand Down

0 comments on commit 15ee51e

Please sign in to comment.