diff --git a/platform/linux/linux.cmake b/platform/linux/linux.cmake index a83f84076..f816a4aad 100644 --- a/platform/linux/linux.cmake +++ b/platform/linux/linux.cmake @@ -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