From 613492a96bb5ddf884a32906aeff5f21ae66e5b1 Mon Sep 17 00:00:00 2001
From: Soeren Peters <peters@irmb.tu-bs.de>
Date: Mon, 22 Feb 2021 14:55:26 +0100
Subject: [PATCH] Add unrecognized #pragma warning only if msvc is NOT used.

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

diff --git a/src/gpu/GridGenerator/CMakeLists.txt b/src/gpu/GridGenerator/CMakeLists.txt
index bca5593ef..408de5368 100644
--- a/src/gpu/GridGenerator/CMakeLists.txt
+++ b/src/gpu/GridGenerator/CMakeLists.txt
@@ -15,7 +15,10 @@ endif()
 # suppress warning 3123, 3126: calling a __host__ function from __host__ __device__ is not allowed
 # suppress warning 3152: __host__ function redeclared with __host__ __device__, hence treated as a __host__ __device__ function
 # suppress warning 3125, 3127: calling a constexpr __host__ function from a __host__ __device__ function
+target_compile_options(${library_name} PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe "--diag_suppress=3123 --diag_suppress=3126 --diag_suppress=3152 --diag_suppress=3125 --diag_suppress=3127" >)
+
 # suppress warning 3311: unrecognized #pragma in device code
-#if(MSVC)
-    target_compile_options(${library_name} PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe "--diag_suppress=3123 --diag_suppress=3126 --diag_suppress=3152 --diag_suppress=3125 --diag_suppress=3127" >)
-#endif()
+if(NOT MSVC)
+    target_compile_options(${library_name} PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe "--diag_suppress=3311" >)
+endif()
+
-- 
GitLab