cmake: enable MLN_WITH_EGL and OPENGL_USE_GLES for Wayland (#2022)

This commit is contained in:
Jonas Vautherin
2024-02-21 13:26:19 +01:00
committed by GitHub
parent f93a646921
commit 61fd33f526

View File

@@ -15,6 +15,18 @@ find_package(Threads REQUIRED)
pkg_search_module(WEBP libwebp REQUIRED)
pkg_search_module(LIBUV libuv REQUIRED)
if(MLN_WITH_WAYLAND)
# See https://github.com/maplibre/maplibre-native/pull/2022
# MLN_WITH_EGL needs to be set for Wayland, otherwise this CMakeLists will
# call find_package(OpenGL REQUIRED GLX), which is for X11.
set(MLN_WITH_EGL TRUE)
# OPENGL_USE_GLES2 or OPENGL_USE_GLES3 need to be set, otherwise
# FindOpenGL.cmake will include the GLVND library, which is for X11.
set(OPENGL_USE_GLES3 TRUE)
endif()
target_sources(
mbgl-core
PRIVATE