GLContext: Wayland support

This commit is contained in:
Connor McLaughlin
2020-07-07 21:40:55 +10:00
parent eab70546c8
commit 4ce5f7e802
5 changed files with 91 additions and 2 deletions

View File

@ -8,6 +8,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules/")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LINUX TRUE)
set(SUPPORTS_X11 TRUE)
set(SUPPORTS_WAYLAND TRUE)
endif()
@ -25,6 +26,9 @@ endif()
if(SUPPORTS_X11)
option(USE_X11 "Support X11 window system" ON)
endif()
if(SUPPORTS_WAYLAND)
option(USE_WAYLAND "Support Wayland window system" OFF)
endif()
if(LINUX OR ANDROID)
option(USE_EGL "Support EGL OpenGL context creation" ON)
endif()
@ -95,6 +99,12 @@ endif()
if(USE_X11)
find_package(X11 REQUIRED)
endif()
if(USE_WAYLAND)
find_package(ECM REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")
find_package(Wayland REQUIRED Egl)
message(STATUS "Wayland support enabled")
endif()
# Set _DEBUG macro for Debug builds.
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")