[Bf-blender-cvs] [a3b3e137856] wl_default: GHOST/X11: link libGL for X11-EGL to resolve OpenGL symbols

Christian Rauch noreply at git.blender.org
Sat Aug 14 22:29:25 CEST 2021


Commit: a3b3e1378567a7b3fe39a8a926d42e8e55916168
Author: Christian Rauch
Date:   Mon Aug 9 20:52:23 2021 +0100
Branches: wl_default
https://developer.blender.org/rBa3b3e1378567a7b3fe39a8a926d42e8e55916168

GHOST/X11: link libGL for X11-EGL to resolve OpenGL symbols

This links libGL if X11-EGL is enabled, since libOpenGL is not installed by
default on some distributions. This is a workaround to resolve the OpenGL
symbols that would otherwise be resolved via GLVND.

Differential Revision: https://developer.blender.org/D12034

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

M	CMakeLists.txt

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae2d4b1c8cb..201608a531a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1189,7 +1189,17 @@ endif()
 
 if(WITH_GL_EGL)
   find_package(OpenGL REQUIRED EGL)
-  list(APPEND BLENDER_GL_LIBRARIES OpenGL::EGL)
+
+  if (WITH_GHOST_WAYLAND AND NOT WITH_GHOST_X11)
+    # Link to libOpenGL (GLVND) and libEGL for pure Wayland builds, since libGL may not
+    # be available on Wayland only systems.
+    list(APPEND BLENDER_GL_LIBRARIES OpenGL::EGL)
+  else()
+    # Link to libGL and libEGL for X11 or mixed X11/Wayland builds, since libOpenGL
+    # is not installed by default on Linux distributions like Ubuntu and we want to
+    # create portable builds.
+    list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_egl_LIBRARY} ${OPENGL_gl_LIBRARY})
+  endif()
 
   list(APPEND GL_DEFINITIONS -DWITH_GL_EGL -DGLEW_EGL -DGLEW_INC_EGL)



More information about the Bf-blender-cvs mailing list