Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Rauch <Rauch.Christian@gmx.de>2021-08-09 22:52:23 +0300
committerChristian Rauch <Rauch.Christian@gmx.de>2021-08-14 23:26:40 +0300
commita3b3e1378567a7b3fe39a8a926d42e8e55916168 (patch)
tree8f501195109076971134aa3786969f3b0b78c66c
parentbb793c1deedc254de009a1ab169c9518d8f408c5 (diff)
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
-rw-r--r--CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
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)