build: only disable win32 cuda warnings on CUDA SDK >= 11.2
authorcudawarped <12133430+cudawarped@users.noreply.github.com>
Wed, 21 Dec 2022 15:09:41 +0000 (17:09 +0200)
committercudawarped <12133430+cudawarped@users.noreply.github.com>
Wed, 21 Dec 2022 15:09:41 +0000 (17:09 +0200)
cmake/OpenCVDetectCUDA.cmake

index bc7391a9954f01d31810e5106f430475d963b888..74b550e669f0292eebd38d2c4ebb45b3fc513df2 100644 (file)
@@ -427,7 +427,7 @@ if(CUDA_FOUND)
       set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fno-finite-math-only)
     endif()
 
-    if(WIN32)
+    if(CUDA_VERSION VERSION_GREATER_EQUAL 11.2 AND WIN32)
       set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcudafe --display_error_number --diag-suppress 1394,1388)
     endif()