[Bf-blender-cvs] [8d40521d332] epoxy: remove GLEW

Christian Rauch noreply at git.blender.org
Fri Jul 1 11:22:01 CEST 2022


Commit: 8d40521d3323daae293b763715a2baa780238a13
Author: Christian Rauch
Date:   Fri Jun 24 22:01:11 2022 +0100
Branches: epoxy
https://developer.blender.org/rB8d40521d3323daae293b763715a2baa780238a13

remove GLEW

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

M	CMakeLists.txt
D	build_files/cmake/Modules/FindGLEW.cmake
M	extern/CMakeLists.txt
D	extern/glew-es/CMakeLists.txt
D	extern/glew-es/LICENSE.txt
D	extern/glew-es/README.blender
D	extern/glew-es/include/GL/eglew.h
D	extern/glew-es/include/GL/glesew.h
D	extern/glew-es/include/GL/glew.h
D	extern/glew-es/include/GL/glxew.h
D	extern/glew-es/include/GL/wglew.h
D	extern/glew-es/src/glew.c
D	extern/glew/CMakeLists.txt
D	extern/glew/LICENSE.txt
D	extern/glew/README.blender
D	extern/glew/include/GL/eglew.h
D	extern/glew/include/GL/glew.h
D	extern/glew/include/GL/glxew.h
D	extern/glew/include/GL/wglew.h
D	extern/glew/src/glew.c
M	release/license/THIRD-PARTY-LICENSES.txt
M	source/blender/freestyle/CMakeLists.txt

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b2b8c56001b..a7bb7ad6c6d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -543,30 +543,18 @@ if(WITH_GHOST_WAYLAND)
 endif()
 
 if(UNIX AND NOT APPLE)
-  if(WITH_GL_EGL)
-    # GLEW can only be built with either GLX or EGL support. Most binary distributions are
-    # built with GLX support and we have no automated way to detect this. So always build
-    # GLEW from source to be sure it has EGL support.
-    set(WITH_SYSTEM_GLEW OFF)
-  else()
-    option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF)
-  endif()
-
   option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON)
 else()
-  # System GLEW and GLES not an option on other platforms.
-  set(WITH_SYSTEM_GLEW OFF)
+  # System GLES not an option on other platforms.
   set(WITH_SYSTEM_GLES OFF)
 endif()
 
 option(WITH_OPENGL              "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON)
-option(WITH_GLEW_ES             "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
 option(WITH_GL_PROFILE_ES20     "Support using OpenGL ES 2.0. (through either EGL or the AGL/WGL/XGL 'es20' profile)"                               OFF)
 option(WITH_GPU_SHADER_BUILDER  "Shader builder is a developer option enabling linting on GLSL during compilation"                                  OFF)
 
 mark_as_advanced(
   WITH_OPENGL
-  WITH_GLEW_ES
   WITH_GL_PROFILE_ES20
   WITH_GPU_SHADER_BUILDER
 )
@@ -589,11 +577,6 @@ if(WIN32)
   mark_as_advanced(WITH_GL_ANGLE)
 endif()
 
-if(WITH_GLEW_ES AND WITH_SYSTEM_GLEW)
-  message(WARNING Ignoring WITH_SYSTEM_GLEW and using WITH_GLEW_ES)
-  set(WITH_SYSTEM_GLEW OFF)
-endif()
-
 if(WIN32)
   getDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
   set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
@@ -1287,7 +1270,7 @@ if(WITH_GL_EGL)
   find_package(OpenGL REQUIRED EGL)
   list(APPEND BLENDER_GL_LIBRARIES OpenGL::EGL)
 
-  list(APPEND GL_DEFINITIONS -DWITH_GL_EGL -DGLEW_EGL -DGLEW_INC_EGL)
+  list(APPEND GL_DEFINITIONS -DWITH_GL_EGL)
 
   if(WITH_SYSTEM_GLES)
     if(NOT OPENGLES_EGL_LIBRARY)
@@ -1380,66 +1363,6 @@ if(WITH_OPENMP)
   )
 endif()
 
-#-----------------------------------------------------------------------------
-# Configure GLEW
-
-if(WITH_SYSTEM_GLEW)
-  find_package(GLEW)
-
-  # Note: There is an assumption here that the system GLEW is not a static library.
-
-  if(NOT GLEW_FOUND)
-    message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
-  endif()
-
-  set(GLEW_INCLUDE_PATH "${GLEW_INCLUDE_DIR}")
-  set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
-else()
-  if(WITH_GLEW_ES)
-    set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include")
-
-    list(APPEND GL_DEFINITIONS -DGLEW_STATIC -DWITH_GLEW_ES)
-
-    # These definitions remove APIs from glew.h, making GLEW smaller, and catching unguarded API usage
-    if(WITH_GL_PROFILE_ES20)
-      list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
-    else()
-      # No ES functions are needed
-      list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
-    endif()
-
-    if(WITH_GL_PROFILE_ES20)
-      if(WITH_GL_EGL)
-        list(APPEND GL_DEFINITIONS -DGLEW_USE_LIB_ES20)
-      endif()
-
-      # ToDo: This is an experiment to eliminate ES 1 symbols,
-      # GLEW doesn't really properly provide this level of control
-      # (for example, without modification it eliminates too many symbols)
-      # so there are lots of modifications to GLEW to make this work,
-      # and no attempt to make it work beyond Blender at this point.
-      list(APPEND GL_DEFINITIONS -DGL_ES_VERSION_1_0=0 -DGL_ES_VERSION_CL_1_1=0 -DGL_ES_VERSION_CM_1_1=0)
-    endif()
-
-    set(BLENDER_GLEW_LIBRARIES extern_glew_es bf_intern_glew_mx)
-
-  else()
-    set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include")
-
-    list(APPEND GL_DEFINITIONS -DGLEW_STATIC)
-
-    # This won't affect the non-experimental glew library,
-    # but is used for conditional compilation elsewhere.
-    list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
-
-    set(BLENDER_GLEW_LIBRARIES extern_glew)
-
-  endif()
-
-endif()
-
-list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
-
 #-----------------------------------------------------------------------------
 # Configure Bullet
 
@@ -1983,9 +1906,6 @@ elseif(WITH_CYCLES_STANDALONE OR WITH_CYCLES_HYDRA_RENDER_DELEGATE)
   if(WITH_HIP_DYNLOAD)
     add_subdirectory(extern/hipew)
   endif()
-  if(NOT WITH_SYSTEM_GLEW)
-    add_subdirectory(extern/glew)
-  endif()
 endif()
 
 #-----------------------------------------------------------------------------
@@ -2078,7 +1998,6 @@ if(FIRST_RUN)
   info_cfg_option(WITH_INSTALL_PORTABLE)
   info_cfg_option(WITH_MEM_JEMALLOC)
   info_cfg_option(WITH_MEM_VALGRIND)
-  info_cfg_option(WITH_SYSTEM_GLEW)
   info_cfg_option(WITH_X11_ALPHA)
   info_cfg_option(WITH_X11_XF86VMODE)
   info_cfg_option(WITH_X11_XFIXES)
@@ -2132,7 +2051,6 @@ if(FIRST_RUN)
   endif()
   info_cfg_option(WITH_GL_EGL)
   info_cfg_option(WITH_GL_PROFILE_ES20)
-  info_cfg_option(WITH_GLEW_ES)
 
   info_cfg_text("")
 
diff --git a/build_files/cmake/Modules/FindGLEW.cmake b/build_files/cmake/Modules/FindGLEW.cmake
deleted file mode 100644
index 33b989ec49e..00000000000
--- a/build_files/cmake/Modules/FindGLEW.cmake
+++ /dev/null
@@ -1,58 +0,0 @@
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright 2014 Blender Foundation.
-
-# - Find GLEW library
-# Find the native Glew includes and library
-# This module defines
-#  GLEW_INCLUDE_DIRS, where to find glew.h, Set when
-#                        GLEW_INCLUDE_DIR is found.
-#  GLEW_ROOT_DIR, The base directory to search for Glew.
-#                    This can also be an environment variable.
-#  GLEW_FOUND, If false, do not try to use Glew.
-#
-# also defined,
-#  GLEW_LIBRARY, where to find the Glew library.
-
-# If GLEW_ROOT_DIR was defined in the environment, use it.
-IF(NOT GLEW_ROOT_DIR AND NOT $ENV{GLEW_ROOT_DIR} STREQUAL "")
-  SET(GLEW_ROOT_DIR $ENV{GLEW_ROOT_DIR})
-ENDIF()
-
-SET(_glew_SEARCH_DIRS
-  ${GLEW_ROOT_DIR}
-)
-
-FIND_PATH(GLEW_INCLUDE_DIR
-  NAMES
-    GL/glew.h
-  HINTS
-    ${_glew_SEARCH_DIRS}
-  PATH_SUFFIXES
-    include
-)
-
-FIND_LIBRARY(GLEW_LIBRARY
-  NAMES
-    GLEW
-  HINTS
-    ${_glew_SEARCH_DIRS}
-  PATH_SUFFIXES
-    lib64 lib
-  )
-
-# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
-# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW DEFAULT_MSG
-    GLEW_LIBRARY GLEW_INCLUDE_DIR)
-
-IF(GLEW_FOUND)
-  SET(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
-ENDIF()
-
-MARK_AS_ADVANCED(
-  GLEW_INCLUDE_DIR
-  GLEW_LIBRARY
-)
-
-UNSET(_glew_SEARCH_DIRS)
diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt
index 35da67d05a4..8a7da1d07ed 100644
--- a/extern/CMakeLists.txt
+++ b/extern/CMakeLists.txt
@@ -32,14 +32,6 @@ if(WITH_BINRELOC)
   add_subdirectory(binreloc)
 endif()
 
-if(NOT WITH_SYSTEM_GLEW)
-  if(WITH_GLEW_ES)
-    add_subdirectory(glew-es)
-  else()
-    add_subdirectory(glew)
-  endif()
-endif()
-
 if(WITH_LZO AND NOT WITH_SYSTEM_LZO)
   add_subdirectory(lzo)
 endif()
diff --git a/extern/glew-es/CMakeLists.txt b/extern/glew-es/CMakeLists.txt
deleted file mode 100644
index 1e334f9995b..00000000000
--- a/extern/glew-es/CMakeLists.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright 2013 Blender Foundation. All rights reserved.
-
-set(INC
-  include
-)
-
-set(INC_SYS
-
-)
-
-if(UNIX)
-  list(APPEND INC_SYS
-    ${X11_X11_INCLUDE_PATH}
-  )
-endif()
-
-set(SRC
-  src/glew.c
-
-  include/GL/eglew.h
-  include/GL/glesew.h
-  include/GL/glew.h
-  include/GL/glxew.h
-  include/GL/wglew.h
-)
-
-set(LIB
-)
-
-add_definitions(${GL_DEFINITIONS})
-
-blender_add_lib(extern_glew_es "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/glew-es/LICENSE.txt b/extern/glew-es/LICENSE.txt
deleted file mode 100644
index f7078042e95..00000000000
--- a/extern/glew-es/LICENSE.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-The OpenGL Extension Wrangler Library
-Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org>
-Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org>
-Copyright (C) 2002, Lev Povalahev
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without 
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, 
-  this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright notice, 
-  this list of conditions and the following disclaimer in the documentation 
-  and/or other materials provided with the distribution.
-* The name of the author may be used to endorse or promote products 
-  derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGE.
-
-
-Mesa 3-D graphics library
-Version:  7.0
-
-Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list