Fix building wheels on Windows (#229)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
||||||
project(sherpa-onnx)
|
project(sherpa-onnx)
|
||||||
|
|
||||||
set(SHERPA_ONNX_VERSION "1.5.4")
|
set(SHERPA_ONNX_VERSION "1.5.5")
|
||||||
|
|
||||||
# Disable warning about
|
# Disable warning about
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -137,9 +137,23 @@ class BuildExtension(build_ext):
|
|||||||
binaries += ["sherpa-onnx-offline-websocket-server"]
|
binaries += ["sherpa-onnx-offline-websocket-server"]
|
||||||
binaries += ["sherpa-onnx-online-websocket-client"]
|
binaries += ["sherpa-onnx-online-websocket-client"]
|
||||||
|
|
||||||
|
if is_windows():
|
||||||
|
binaries += ["kaldi-native-fbank-core.dll"]
|
||||||
|
binaries += ["sherpa-onnx-c-api.dll"]
|
||||||
|
binaries += ["sherpa-onnx-core.dll"]
|
||||||
|
binaries += ["sherpa-onnx-portaudio.dll"]
|
||||||
|
binaries += ["onnxruntime.dll"]
|
||||||
|
|
||||||
for f in binaries:
|
for f in binaries:
|
||||||
|
suffix = "" if "dll" in f else suffix
|
||||||
src_file = install_dir / "bin" / (f + suffix)
|
src_file = install_dir / "bin" / (f + suffix)
|
||||||
|
if not src_file.is_file():
|
||||||
|
src_file = install_dir / "lib" / (f + suffix)
|
||||||
|
if not src_file.is_file():
|
||||||
|
src_file = install_dir / ".." / (f + suffix)
|
||||||
print(f"Copying {src_file} to {out_bin_dir}/")
|
print(f"Copying {src_file} to {out_bin_dir}/")
|
||||||
shutil.copy(f"{src_file}", f"{out_bin_dir}/")
|
shutil.copy(f"{src_file}", f"{out_bin_dir}/")
|
||||||
|
|
||||||
shutil.rmtree(f"{install_dir}/bin")
|
shutil.rmtree(f"{install_dir}/bin")
|
||||||
|
if is_windows():
|
||||||
|
shutil.rmtree(f"{install_dir}/lib")
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
<UseOfMfc>Static</UseOfMfc>
|
<UseOfMfc>Static</UseOfMfc>
|
||||||
|
|||||||
7
setup.py
7
setup.py
@@ -54,9 +54,16 @@ def get_binaries_to_install():
|
|||||||
binaries += ["sherpa-onnx-online-websocket-server"]
|
binaries += ["sherpa-onnx-online-websocket-server"]
|
||||||
binaries += ["sherpa-onnx-offline-websocket-server"]
|
binaries += ["sherpa-onnx-offline-websocket-server"]
|
||||||
binaries += ["sherpa-onnx-online-websocket-client"]
|
binaries += ["sherpa-onnx-online-websocket-client"]
|
||||||
|
if is_windows():
|
||||||
|
binaries += ["kaldi-native-fbank-core.dll"]
|
||||||
|
binaries += ["sherpa-onnx-c-api.dll"]
|
||||||
|
binaries += ["sherpa-onnx-core.dll"]
|
||||||
|
binaries += ["sherpa-onnx-portaudio.dll"]
|
||||||
|
binaries += ["onnxruntime.dll"]
|
||||||
|
|
||||||
exe = []
|
exe = []
|
||||||
for f in binaries:
|
for f in binaries:
|
||||||
|
suffix = "" if "dll" in f else suffix
|
||||||
t = bin_dir / (f + suffix)
|
t = bin_dir / (f + suffix)
|
||||||
exe.append(str(t))
|
exe.append(str(t))
|
||||||
return exe
|
return exe
|
||||||
|
|||||||
Reference in New Issue
Block a user