From 76924858314bd7016915364eac7f8f68f8fcedcd Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 13 Aug 2020 09:25:27 -0400 Subject: [PATCH] Make sure we use c++14 when using CUDA 11+ --- CMake/VTKmDeviceAdapters.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMake/VTKmDeviceAdapters.cmake b/CMake/VTKmDeviceAdapters.cmake index e7d6e0412..e2d6051e9 100644 --- a/CMake/VTKmDeviceAdapters.cmake +++ b/CMake/VTKmDeviceAdapters.cmake @@ -132,6 +132,12 @@ if(VTKm_ENABLE_CUDA) INTERFACE_COMPILE_OPTIONS $<$:--expt-relaxed-constexpr> ) + if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND + CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0) + # CUDA 11+ deprecated C++11 support + target_compile_features(vtkm_cuda INTERFACE cxx_std_14) + endif() + # add the -gencode flags so that all cuda code # way compiled properly