Skip to content

Commit ce94736

Browse files
authored
Add support for building Windows on ARM64 (WOA) wheels (#608)
1 parent 43dd824 commit ce94736

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

.github/workflows/sounddevice-data.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ jobs:
1414
arch: 'x64'
1515
- os: windows-latest
1616
arch: 'x86'
17+
- os: windows-11-arm
18+
arch: 'arm64'
1719
runs-on: ${{ matrix.os }}
1820
steps:
1921
- name: Set up Python
2022
uses: actions/setup-python@v6
2123
with:
22-
python-version: "3.10"
24+
python-version: "3.13"
2325
architecture: ${{ matrix.arch }}
2426
- name: Double-check Python version
2527
run: |

make_dist.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ make_wheel Windows 32bit
1919

2020
make_wheel Windows 64bit
2121

22+
make_wheel Windows arm64
23+
2224
# This makes sure that the libraries are not copied to the final sdist:
2325
rm -rf sounddevice.egg-info/
2426

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

1717
# environment variables for cross-platform package creation
1818
system = os.environ.get('PYTHON_SOUNDDEVICE_PLATFORM', platform.system())
19+
machine = platform.machine().lower()
1920
architecture0 = os.environ.get('PYTHON_SOUNDDEVICE_ARCHITECTURE',
20-
platform.architecture()[0])
21+
'arm64' if machine in ['arm64', 'aarch64'] else platform.architecture()[0])
2122

2223
if system == 'Darwin':
2324
libname = 'libportaudio.dylib'
@@ -52,7 +53,9 @@ def get_tag(self):
5253
if system == 'Darwin':
5354
oses = MACOSX_VERSIONS
5455
elif system == 'Windows':
55-
if architecture0 == '32bit':
56+
if architecture0 == 'arm64':
57+
oses = 'win_arm64'
58+
elif architecture0 == '32bit':
5659
oses = 'win32'
5760
else:
5861
oses = 'win_amd64'

sounddevice.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,14 @@
7474
if _platform.system() == 'Darwin':
7575
_libname = 'libportaudio.dylib'
7676
elif _platform.system() == 'Windows':
77+
if _platform.machine().lower() in ('arm64', 'aarch64'):
78+
_platform_suffix = 'arm64'
79+
else:
80+
_platform_suffix = _platform.architecture()[0]
7781
if 'SD_ENABLE_ASIO' in _os.environ:
78-
_libname = 'libportaudio' + _platform.architecture()[0] + '-asio.dll'
82+
_libname = 'libportaudio' + _platform_suffix + '-asio.dll'
7983
else:
80-
_libname = 'libportaudio' + _platform.architecture()[0] + '.dll'
84+
_libname = 'libportaudio' + _platform_suffix + '.dll'
8185
else:
8286
raise
8387
import _sounddevice_data

0 commit comments

Comments
 (0)