@@ -88,16 +88,17 @@ function(make_torchcodec_libraries
8888 #
8989 # 1. libtorchcodec_coreN.{ext}: Base library which contains the
9090 # implementation of VideoDecoder and everything VideoDecoder needs. On
91- # Linux, {ext} is so. On Mac, it is dylib.
91+ # Linux, {ext} is so. On Mac, it is dylib. On Windows it's dll.
9292 #
9393 # 2. libtorchcodec_custom_opsN.{ext}: Implementation of the PyTorch custom
9494 # ops. Depends on libtorchcodec_coreN.{ext}. On Linux, {ext} is so.
95- # On Mac, it is dylib.
95+ # On Mac, it is dylib. On Windows it's dll.
9696 #
9797 # 3. libtorchcodec_pybind_opsN.{ext}: Implementation of the pybind11 ops. We
9898 # keep these separate from the PyTorch custom ops because we have to
9999 # load these libraries separately on the Python side. Depends on
100- # libtorchcodec_coreN.{ext}. On BOTH Linux and Mac {ext} is so.
100+ # libtorchcodec_coreN.{ext}. On BOTH Linux and Mac {ext} is so. On
101+ # Windows, it's pyd.
101102
102103 # 1. Create libtorchcodec_coreN.{ext}.
103104 set (core_library_name "libtorchcodec_core${ffmpeg_major_version} " )
@@ -180,6 +181,9 @@ function(make_torchcodec_libraries
180181 )
181182
182183 if (WIN32 )
184+ # On Windows, we need to set the suffix to .pyd so that Python can
185+ # import the shared library as a module. Just setting the MODULE type
186+ # isn't enough.
183187 set_target_properties (${pybind_ops_library_name} PROPERTIES SUFFIX ".pyd" )
184188 endif ()
185189
@@ -232,7 +236,7 @@ function(make_torchcodec_libraries
232236 install (
233237 TARGETS ${all_libraries}
234238 LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}
235- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} # For Windows DLLs
239+ RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} # For Windows
236240 )
237241
238242endfunction ()
0 commit comments