Fangjun Kuang
Committed by GitHub

Fix building wheels for windows (#365)

@@ -6,6 +6,7 @@ on: @@ -6,6 +6,7 @@ on:
6 - wheel 6 - wheel
7 tags: 7 tags:
8 - '*' 8 - '*'
  9 + workflow_dispatch:
9 10
10 env: 11 env:
11 SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 12 SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
@@ -6,6 +6,7 @@ on: @@ -6,6 +6,7 @@ on:
6 - wheel 6 - wheel
7 tags: 7 tags:
8 - '*' 8 - '*'
  9 + workflow_dispatch:
9 10
10 env: 11 env:
11 SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 12 SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
@@ -6,6 +6,7 @@ on: @@ -6,6 +6,7 @@ on:
6 - wheel 6 - wheel
7 tags: 7 tags:
8 - '*' 8 - '*'
  9 + workflow_dispatch:
9 10
10 env: 11 env:
11 SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 12 SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
@@ -6,6 +6,7 @@ on: @@ -6,6 +6,7 @@ on:
6 - wheel 6 - wheel
7 tags: 7 tags:
8 - '*' 8 - '*'
  9 + workflow_dispatch:
9 10
10 env: 11 env:
11 SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 12 SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1
@@ -146,11 +146,11 @@ class BuildExtension(build_ext): @@ -146,11 +146,11 @@ class BuildExtension(build_ext):
146 binaries += ["sherpa-onnx-portaudio.dll"] 146 binaries += ["sherpa-onnx-portaudio.dll"]
147 binaries += ["onnxruntime.dll"] 147 binaries += ["onnxruntime.dll"]
148 binaries += ["kaldi-decoder-core.dll"] 148 binaries += ["kaldi-decoder-core.dll"]
149 - binaries += ["sherpa-onnx-fst.dll"]  
150 - binaries += ["sherpa-onnx-kaldifst-core.dll"] 149 + binaries += ["sherpa-onnx-fst.lib"]
  150 + binaries += ["sherpa-onnx-kaldifst-core.lib"]
151 151
152 for f in binaries: 152 for f in binaries:
153 - suffix = "" if "dll" in f else suffix 153 + suffix = "" if (".dll" in f or ".lib" in f) else suffix
154 src_file = install_dir / "bin" / (f + suffix) 154 src_file = install_dir / "bin" / (f + suffix)
155 if not src_file.is_file(): 155 if not src_file.is_file():
156 src_file = install_dir / "lib" / (f + suffix) 156 src_file = install_dir / "lib" / (f + suffix)
@@ -65,12 +65,12 @@ def get_binaries_to_install(): @@ -65,12 +65,12 @@ def get_binaries_to_install():
65 binaries += ["sherpa-onnx-portaudio.dll"] 65 binaries += ["sherpa-onnx-portaudio.dll"]
66 binaries += ["onnxruntime.dll"] 66 binaries += ["onnxruntime.dll"]
67 binaries += ["kaldi-decoder-core.dll"] 67 binaries += ["kaldi-decoder-core.dll"]
68 - binaries += ["sherpa-onnx-fst.dll"]  
69 - binaries += ["sherpa-onnx-kaldifst-core.dll"] 68 + binaries += ["sherpa-onnx-fst.lib"]
  69 + binaries += ["sherpa-onnx-kaldifst-core.lib"]
70 70
71 exe = [] 71 exe = []
72 for f in binaries: 72 for f in binaries:
73 - suffix = "" if "dll" in f else suffix 73 + suffix = "" if (".dll" in f or ".lib" in f) else suffix
74 t = bin_dir / (f + suffix) 74 t = bin_dir / (f + suffix)
75 exe.append(str(t)) 75 exe.append(str(t))
76 return exe 76 return exe