diff options
author | Christian Rauch <Rauch.Christian@gmx.de> | 2021-07-26 23:55:43 +0300 |
---|---|---|
committer | Christian Rauch <Rauch.Christian@gmx.de> | 2021-07-29 19:39:55 +0300 |
commit | 0b18a618b88b22663e05eca0f4d976875710e7cc (patch) | |
tree | 1eca989d075981b8f01c191bc230f8eb6cbe643a /CMakeLists.txt | |
parent | c7b12e31e6f752f05aacdc0dca5e0e0783faa2e7 (diff) |
GHOST/X11: enable EGL
This will replace GLX with EGL for X11. GLEW does not support GLX and EGL
at the same time. Most distributions build GLEW with GLX support, so we
have to use the externally provided GLEW and build with EGL support.
This effectively sets WITH_SYSTEM_GLEW to OFF for all Linux configurations.
Differential Revision: https://developer.blender.org/D12034
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c6408bee2c..5072977215d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,16 +252,6 @@ if(WITH_GHOST_X11) endif() if(UNIX AND NOT APPLE) - option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF) - option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON) -else() - # not an option for other OS's - set(WITH_SYSTEM_GLEW OFF) - set(WITH_SYSTEM_GLES OFF) -endif() - - -if(UNIX AND NOT APPLE) option(WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF) endif() @@ -485,15 +475,32 @@ endif() # OpenGL +if(UNIX AND NOT APPLE) + # GLEW can only built with either GLX or EGL support and most binary + # distributions are built with GLX support. So we always compile GLEW + # with EGL support manually, and the options are no longer available. + set(WITH_SYSTEM_GLEW OFF) + set(WITH_SYSTEM_GLES ON) + + # Always use EGL instead of GLX, for X11, Wayland and headless. + set(WITH_GL_EGL ON) +else() + # System GLEW and GLES were never an option on other platforms. + set(WITH_SYSTEM_GLEW OFF) + set(WITH_SYSTEM_GLES OFF) + + # Experimental EGL option. + option(WITH_GL_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL or WGL)" OFF) + mark_as_advanced(WITH_GL_EGL) +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_EGL "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)" OFF) option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (through either EGL or the AGL/WGL/XGL 'es20' profile)" OFF) mark_as_advanced( WITH_OPENGL WITH_GLEW_ES - WITH_GL_EGL WITH_GL_PROFILE_ES20 ) |