From 9ffc202be4f3215cde33b779508874a85d8004bb Mon Sep 17 00:00:00 2001
From: Soeren Peters <peters@irmb.tu-bs.de>
Date: Fri, 26 Feb 2021 09:43:51 +0100
Subject: [PATCH] Need to set CUDA_STANDARD at least to 11 with msvc.

---
 CMakeLists.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b933f634f..5c67ec6b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,13 +103,16 @@ if(BUILD_VF_GPU)
         message(FATAL_ERROR "CUDA Compiler was requested but is not found on the system.")
     endif()
 
-    if(NOT MSVC) 
+    if(MSVC) 
         # With the MSVC compiler we got this warning: nvcc : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.
-        # But we build the c++ code with C++14. Until we have not a solution here, we are not setting this on MSVC.
+        # But we build the c++ code with C++14. Until we have not a solution here, we set the standard to 11 here.
+        set(CMAKE_CUDA_STANDARD 11)
+    else()
         set(CMAKE_CUDA_STANDARD 14)
-        set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
     endif()
 
+    set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
+
     set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcudafe --display_error_number")
 
     if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
-- 
GitLab