正在显示
4 个修改的文件
包含
23 行增加
和
2 行删除
| @@ -137,9 +137,23 @@ class BuildExtension(build_ext): | @@ -137,9 +137,23 @@ class BuildExtension(build_ext): | ||
| 137 | binaries += ["sherpa-onnx-offline-websocket-server"] | 137 | binaries += ["sherpa-onnx-offline-websocket-server"] |
| 138 | binaries += ["sherpa-onnx-online-websocket-client"] | 138 | binaries += ["sherpa-onnx-online-websocket-client"] |
| 139 | 139 | ||
| 140 | + if is_windows(): | ||
| 141 | + binaries += ["kaldi-native-fbank-core.dll"] | ||
| 142 | + binaries += ["sherpa-onnx-c-api.dll"] | ||
| 143 | + binaries += ["sherpa-onnx-core.dll"] | ||
| 144 | + binaries += ["sherpa-onnx-portaudio.dll"] | ||
| 145 | + binaries += ["onnxruntime.dll"] | ||
| 146 | + | ||
| 140 | for f in binaries: | 147 | for f in binaries: |
| 148 | + suffix = "" if "dll" in f else suffix | ||
| 141 | src_file = install_dir / "bin" / (f + suffix) | 149 | src_file = install_dir / "bin" / (f + suffix) |
| 150 | + if not src_file.is_file(): | ||
| 151 | + src_file = install_dir / "lib" / (f + suffix) | ||
| 152 | + if not src_file.is_file(): | ||
| 153 | + src_file = install_dir / ".." / (f + suffix) | ||
| 142 | print(f"Copying {src_file} to {out_bin_dir}/") | 154 | print(f"Copying {src_file} to {out_bin_dir}/") |
| 143 | shutil.copy(f"{src_file}", f"{out_bin_dir}/") | 155 | shutil.copy(f"{src_file}", f"{out_bin_dir}/") |
| 144 | 156 | ||
| 145 | shutil.rmtree(f"{install_dir}/bin") | 157 | shutil.rmtree(f"{install_dir}/bin") |
| 158 | + if is_windows(): | ||
| 159 | + shutil.rmtree(f"{install_dir}/lib") |
| @@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
| 36 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | 36 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
| 37 | <ConfigurationType>Application</ConfigurationType> | 37 | <ConfigurationType>Application</ConfigurationType> |
| 38 | <UseDebugLibraries>false</UseDebugLibraries> | 38 | <UseDebugLibraries>false</UseDebugLibraries> |
| 39 | - <PlatformToolset>v142</PlatformToolset> | 39 | + <PlatformToolset>v143</PlatformToolset> |
| 40 | <WholeProgramOptimization>true</WholeProgramOptimization> | 40 | <WholeProgramOptimization>true</WholeProgramOptimization> |
| 41 | <CharacterSet>Unicode</CharacterSet> | 41 | <CharacterSet>Unicode</CharacterSet> |
| 42 | <UseOfMfc>Static</UseOfMfc> | 42 | <UseOfMfc>Static</UseOfMfc> |
| @@ -54,9 +54,16 @@ def get_binaries_to_install(): | @@ -54,9 +54,16 @@ def get_binaries_to_install(): | ||
| 54 | binaries += ["sherpa-onnx-online-websocket-server"] | 54 | binaries += ["sherpa-onnx-online-websocket-server"] |
| 55 | binaries += ["sherpa-onnx-offline-websocket-server"] | 55 | binaries += ["sherpa-onnx-offline-websocket-server"] |
| 56 | binaries += ["sherpa-onnx-online-websocket-client"] | 56 | binaries += ["sherpa-onnx-online-websocket-client"] |
| 57 | + if is_windows(): | ||
| 58 | + binaries += ["kaldi-native-fbank-core.dll"] | ||
| 59 | + binaries += ["sherpa-onnx-c-api.dll"] | ||
| 60 | + binaries += ["sherpa-onnx-core.dll"] | ||
| 61 | + binaries += ["sherpa-onnx-portaudio.dll"] | ||
| 62 | + binaries += ["onnxruntime.dll"] | ||
| 57 | 63 | ||
| 58 | exe = [] | 64 | exe = [] |
| 59 | for f in binaries: | 65 | for f in binaries: |
| 66 | + suffix = "" if "dll" in f else suffix | ||
| 60 | t = bin_dir / (f + suffix) | 67 | t = bin_dir / (f + suffix) |
| 61 | exe.append(str(t)) | 68 | exe.append(str(t)) |
| 62 | return exe | 69 | return exe |
-
请 注册 或 登录 后发表评论