diff --git a/3d-viewer/common_ogl/openGL_includes.h b/3d-viewer/common_ogl/openGL_includes.h index a91ca2ca43..6aa068b7a5 100644 --- a/3d-viewer/common_ogl/openGL_includes.h +++ b/3d-viewer/common_ogl/openGL_includes.h @@ -31,11 +31,6 @@ #define OPENGL_INCLUDES_H #ifdef __APPLE__ -#ifndef GL_SILENCE_DEPRECATION -// Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated. -// Luckily we can silence warnings about its deprecation. -#define GL_SILENCE_DEPRECATION 1 -#endif #include #include #else diff --git a/CMakeLists.txt b/CMakeLists.txt index 4dcfca9e10..932463427d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,12 @@ if( WIN32 ) add_compile_definitions( WIN32_LEAN_AND_MEAN ) endif() +if( APPLE ) + # Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated. + # Luckily we can silence warnings about its deprecation. + add_compile_definitions( GL_SILENCE_DEPRECATION=1 ) +endif() + # Create a flag to identify the non-Apple unix systems if( UNIX AND NOT APPLE ) set( UNIX_NOT_APPLE ON ) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index c3bffcf021..0ff78ccaca 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -26,12 +26,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -// Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated. -// Luckily we can silence warnings about its deprecation. -#ifdef __APPLE__ -#define GL_SILENCE_DEPRECATION 1 -#endif - #include #include #include diff --git a/include/gal/opengl/kiglew.h b/include/gal/opengl/kiglew.h index c011541323..59a3e3c74a 100644 --- a/include/gal/opengl/kiglew.h +++ b/include/gal/opengl/kiglew.h @@ -31,11 +31,6 @@ // Pull in the configuration options for wxWidgets #include -// Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated. -// Luckily we can silence warnings about its deprecation. This is needed on the GLEW -// includes since they transitively include the OpenGL headers. -#define GL_SILENCE_DEPRECATION 1 - #if defined( __unix__ ) and not defined( __APPLE__ ) #ifdef KICAD_USE_EGL diff --git a/utils/idftools/vrml_layer.h b/utils/idftools/vrml_layer.h index d645eb885d..df322f7e6f 100644 --- a/utils/idftools/vrml_layer.h +++ b/utils/idftools/vrml_layer.h @@ -35,12 +35,6 @@ #ifndef VRML_LAYER_H #define VRML_LAYER_H -// Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated. -// Luckily we can silence warnings about its deprecation. -#ifdef __APPLE__ -#define GL_SILENCE_DEPRECATION 1 -#endif - #include // CALLBACK definition, needed on Windows // also needed on OSX to define __DARWIN__