diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index 5886f4f..5f294b5 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -1566,6 +1566,9 @@ macro(ocv_add_cuda_compile_flags) target_compile_options(${target} PRIVATE $<$: ${CUDA_NVCC_FLAGS} "-Xcompiler=${CMAKE_CXX_FLAGS_CUDA} $<$:${CMAKE_CXX_FLAGS_DEBUG_CUDA}> \ $<$:${CMAKE_CXX_FLAGS_RELEASE_CUDA}>" >) + if(MSVC) + target_compile_options(${target} PRIVATE $<$:-Xcompiler=/Zc:preprocessor>) + endif() endmacro() function(ocv_add_executable target)