From c5c66f87d2e40e80ab4f606ebe2a06b82851928e Mon Sep 17 00:00:00 2001 From: cudawarped <12133430+cudawarped@users.noreply.github.com> Date: Thu, 20 Mar 2025 07:05:45 +0200 Subject: [PATCH] Force C++17 Standard for CUDA targets when toolkit >=12.8 as required by the latest versions of Thrust. --- modules/cudev/test/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/cudev/test/CMakeLists.txt b/modules/cudev/test/CMakeLists.txt index ff936cad54c..2ff4ebc1d2b 100644 --- a/modules/cudev/test/CMakeLists.txt +++ b/modules/cudev/test/CMakeLists.txt @@ -22,7 +22,11 @@ if(OCV_DEPENDENCIES_FOUND) if(CUDA_VERSION VERSION_LESS "11.0") ocv_update(OPENCV_CUDA_OPTIONS_opencv_test_cudev "-std=c++11") else() - ocv_update(OPENCV_CUDA_OPTIONS_opencv_test_cudev "-std=c++14") + if(CUDA_VERSION VERSION_LESS "12.8") + ocv_update(OPENCV_CUDA_OPTIONS_opencv_test_cudev "-std=c++14") + else() + ocv_update(OPENCV_CUDA_OPTIONS_opencv_test_cudev "-std=c++17") + endif() ocv_warnings_disable(CMAKE_CXX_FLAGS -Wdeprecated-declarations) endif() CUDA_ADD_EXECUTABLE(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} OPTIONS ${OPENCV_CUDA_OPTIONS_opencv_test_cudev})