Skip to content

Commit 54c4091

Browse files
authored
Fix Windows CUDA builds, maybe (#1468)
1 parent fbed048 commit 54c4091

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/torchcodec/_core/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ function(make_torchcodec_libraries
170170
# https://github.com/pytorch/pytorch/blob/98e36864e640023a716e058d894ea2d20e76e5f7/torch/csrc/inductor/aoti_torch/c/shim.h#L573-L602
171171
target_compile_definitions(${core_library_name} PRIVATE USE_CUDA)
172172
set_property(TARGET ${core_library_name} PROPERTY CUDA_STANDARD 17)
173+
if(WIN32)
174+
# CUDA 13.2+ CCCL headers require MSVC's standard-conforming
175+
# preprocessor when compiling .cu files.
176+
target_compile_options(${core_library_name} PRIVATE
177+
$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=/Zc:preprocessor>)
178+
endif()
173179
endif()
174180

175181
# 2. Create libtorchcodec_custom_opsN.{ext}.

0 commit comments

Comments
 (0)