cmake: use OpenGL::GLES3 when OpenGL::GL does not exist (#13260)

This will allow to build on some systems without X.
This commit is contained in:
Yingjie Wang 2026-02-13 18:40:30 -05:00 committed by GitHub
parent 81a029e504
commit eb0d3f9f01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -476,7 +476,11 @@ function(protocolWayland)
set(PROTOCOL_SOURCES "${PROTOCOL_SOURCES}" PARENT_SCOPE)
endfunction()
target_link_libraries(hyprland_lib PUBLIC OpenGL::EGL OpenGL::GL Threads::Threads)
if(TARGET OpenGL::GL)
target_link_libraries(hyprland_lib PUBLIC OpenGL::EGL OpenGL::GL Threads::Threads)
else()
target_link_libraries(hyprland_lib PUBLIC OpenGL::EGL OpenGL::GLES3 Threads::Threads)
endif()
pkg_check_modules(hyprland_protocols_dep hyprland-protocols>=0.6.4)
if(hyprland_protocols_dep_FOUND)