File tree Expand file tree Collapse file tree 2 files changed +7
-23
lines changed
Expand file tree Collapse file tree 2 files changed +7
-23
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
66set (PYBIND11_FINDPYTHON ON )
77find_package (pybind11 REQUIRED)
88find_package (Torch REQUIRED)
9+
10+ if (WIN32 )
11+ set (Python3_FIND_ABI "ANY" "ANY" "ANY" "ANY" )
12+ endif ()
913find_package (Python3 ${PYTHON_VERSION} EXACT COMPONENTS Development)
1014
1115if (DEFINED TORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR AND TORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR)
@@ -141,6 +145,9 @@ function(make_torchcodec_libraries
141145 ${core_library_name}
142146 ${Python3_LIBRARIES}
143147 )
148+ if (WIN32 )
149+ list (APPEND custom_ops_dependencies Python3::Python)
150+ endif ()
144151 make_torchcodec_sublibrary(
145152 "${custom_ops_library_name} "
146153 SHARED
Original file line number Diff line number Diff line change 1313from typing import List , Optional , Tuple , Union
1414
1515import torch
16-
17-
18- def _init_dll_path ():
19- """Initialize DLL search paths for Windows
20-
21- On Windows Python-3.8+ has `os.add_dll_directory` call,
22- which is called to configure dll search path.
23- To find FFmpeg and other dependent dlls we need to make sure the
24- conda environment/bin path and other system paths are configured.
25- """
26- if os .name == "nt" :
27- for path in os .environ .get ("PATH" , "" ).split (";" ):
28- if os .path .exists (path ):
29- try :
30- os .add_dll_directory (path )
31- except Exception :
32- # Ignore paths that can't be added
33- pass
34-
35-
36- # Initialize DLL paths on Windows before attempting to load libraries
37- if os .name == "nt" :
38- _init_dll_path ()
3916from torch .library import get_ctx , register_fake
4017
4118from torchcodec ._internally_replaced_utils import ( # @manual=//pytorch/torchcodec/src:internally_replaced_utils
You can’t perform that action at this time.
0 commit comments