[Bf-blender-cvs] [387fc9b40b4] master: MacOS: Silence OpenGL deprecation warnings.

Jeroen Bakker noreply at git.blender.org
Tue Jan 10 15:00:38 CET 2023


Commit: 387fc9b40b41ff6e0039332052dedeeda0962b5b
Author: Jeroen Bakker
Date:   Tue Jan 10 14:57:23 2023 +0100
Branches: master
https://developer.blender.org/rB387fc9b40b41ff6e0039332052dedeeda0962b5b

MacOS: Silence OpenGL deprecation warnings.

OpenGL is deprecated by Apple and triggers a warning when used. The goal
is that OpenGL is replaced by Metal backend, but we are not there yet.

To improve tracability of new warnings we hide deprecation warnings
when the GHOST_ContextCGL.h file is included.

NOTE: This change silences other deprecation warnings as well.

===================================================================

M	intern/ghost/intern/GHOST_SystemCocoa.mm
M	intern/ghost/intern/GHOST_WindowCocoa.mm
M	source/blender/gpu/metal/mtl_context.hh

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index b8463286eab..f8e86e1a720 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -16,6 +16,12 @@
 #include "GHOST_WindowCocoa.h"
 #include "GHOST_WindowManager.h"
 
+/* Don't generate OpenGL deprecation warning. This is a known thing, and is not something easily
+ * solvable in a short term. */
+#ifdef __clang__
+#  pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 #include "GHOST_ContextCGL.h"
 
 #ifdef WITH_VULKAN_BACKEND
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 8748bbaeb35..849e59cd809 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -6,6 +6,12 @@
 #include "GHOST_Debug.h"
 #include "GHOST_SystemCocoa.h"
 
+/* Don't generate OpenGL deprecation warning. This is a known thing, and is not something easily
+ * solvable in a short term. */
+#ifdef __clang__
+#  pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 #include "GHOST_ContextCGL.h"
 
 #ifdef WITH_VULKAN_BACKEND
diff --git a/source/blender/gpu/metal/mtl_context.hh b/source/blender/gpu/metal/mtl_context.hh
index e2789dbf9a7..ce2fd357ca9 100644
--- a/source/blender/gpu/metal/mtl_context.hh
+++ b/source/blender/gpu/metal/mtl_context.hh
@@ -12,6 +12,12 @@
 #include "GPU_common_types.h"
 #include "GPU_context.h"
 
+/* Don't generate OpenGL deprecation warning. This is a known thing, and is not something easily
+ * solvable in a short term. */
+#ifdef __clang__
+#  pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 #include "intern/GHOST_Context.h"
 #include "intern/GHOST_ContextCGL.h"
 #include "intern/GHOST_Window.h"



More information about the Bf-blender-cvs mailing list