From f5f9caf580a38c4099e4d3369c13912449cc476c Mon Sep 17 00:00:00 2001
From: Soeren Peters <peters@irmb.tu-bs.de>
Date: Fri, 26 Feb 2021 09:33:31 +0100
Subject: [PATCH] Set the CUDA_CXX_STANDARD to 14, when we are not on msvc.
 Descripting why is in the comment.

---
 CMakeLists.txt | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2ffbb4b4e..b933f634f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,8 +103,12 @@ if(BUILD_VF_GPU)
         message(FATAL_ERROR "CUDA Compiler was requested but is not found on the system.")
     endif()
 
-    set(CMAKE_CUDA_STANDARD 11)
-    set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
+    if(NOT 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.
+        set(CMAKE_CUDA_STANDARD 14)
+        set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
+    endif()
 
     set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcudafe --display_error_number")
 
-- 
GitLab