Skip to content

Commit

Permalink
Fix building wheels for windows (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Oct 14, 2023
1 parent 655e0fa commit 0df0a73
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-wheels-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- wheel
tags:
- '*'
workflow_dispatch:

env:
SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-wheels-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- wheel
tags:
- '*'
workflow_dispatch:

env:
SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-wheels-win32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- wheel
tags:
- '*'
workflow_dispatch:

env:
SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- wheel
tags:
- '*'
workflow_dispatch:

env:
SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
Expand Down
6 changes: 3 additions & 3 deletions cmake/cmake_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ def build_extension(self, ext: setuptools.extension.Extension):
binaries += ["sherpa-onnx-portaudio.dll"]
binaries += ["onnxruntime.dll"]
binaries += ["kaldi-decoder-core.dll"]
binaries += ["sherpa-onnx-fst.dll"]
binaries += ["sherpa-onnx-kaldifst-core.dll"]
binaries += ["sherpa-onnx-fst.lib"]
binaries += ["sherpa-onnx-kaldifst-core.lib"]

for f in binaries:
suffix = "" if "dll" in f else suffix
suffix = "" if (".dll" in f or ".lib" in f) else suffix
src_file = install_dir / "bin" / (f + suffix)
if not src_file.is_file():
src_file = install_dir / "lib" / (f + suffix)
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ def get_binaries_to_install():
binaries += ["sherpa-onnx-portaudio.dll"]
binaries += ["onnxruntime.dll"]
binaries += ["kaldi-decoder-core.dll"]
binaries += ["sherpa-onnx-fst.dll"]
binaries += ["sherpa-onnx-kaldifst-core.dll"]
binaries += ["sherpa-onnx-fst.lib"]
binaries += ["sherpa-onnx-kaldifst-core.lib"]

exe = []
for f in binaries:
suffix = "" if "dll" in f else suffix
suffix = "" if (".dll" in f or ".lib" in f) else suffix
t = bin_dir / (f + suffix)
exe.append(str(t))
return exe
Expand Down

0 comments on commit 0df0a73

Please sign in to comment.