Unverified Commit 56a010b0 authored by Yi Zhang's avatar Yi Zhang Committed by GitHub
Browse files

set libtorch audio suffix as pyd on Windows (#1788)

parent c69955c6
...@@ -11,7 +11,7 @@ def _init_extension(): ...@@ -11,7 +11,7 @@ def _init_extension():
warnings.warn('torchaudio C++ extension is not available.') warnings.warn('torchaudio C++ extension is not available.')
return return
suffix = 'dll' if os.name == 'nt' else 'so' suffix = 'pyd' if os.name == 'nt' else 'so'
path = Path(__file__).parent / 'lib' / f'libtorchaudio.{suffix}' path = Path(__file__).parent / 'lib' / f'libtorchaudio.{suffix}'
# In case `torchaudio` is deployed with `pex` format, this file does not exist. # In case `torchaudio` is deployed with `pex` format, this file does not exist.
# In this case, we expect that `libtorchaudio` is available somewhere # In this case, we expect that `libtorchaudio` is available somewhere
......
...@@ -90,6 +90,10 @@ if(USE_CUDA) ...@@ -90,6 +90,10 @@ if(USE_CUDA)
) )
endif() endif()
if (MSVC)
set_target_properties(libtorchaudio PROPERTIES SUFFIX ".pyd")
endif(MSVC)
install( install(
TARGETS libtorchaudio TARGETS libtorchaudio
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment