From 49523cb4d844a6e8c699ebcd50e207764e9efd96 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Sat, 15 Jun 2024 20:37:23 -0400 Subject: [PATCH] Add option to use wayland on linux, enabled by default --- CMakeLists.txt | 1 + cmake/bgfx/bgfx.cmake | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea5eb339..681c41a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,7 @@ option(BGFX_INSTALL "Create installation target." ON) cmake_dependent_option( BGFX_INSTALL_EXAMPLES "Install examples and their runtimes." OFF "BGFX_INSTALL;BGFX_BUILD_EXAMPLES" OFF ) +cmake_dependent_option(BGFX_WITH_WAYLAND "Use Wayland backend." ON "CMAKE_SYSTEM_NAME STREQUAL 'Linux'" OFF) option(BGFX_CUSTOM_TARGETS "Include convenience custom targets." ON) option(BGFX_CONFIG_MULTITHREADED "Build bgfx with multithreaded configuration" ON) option(BGFX_CONFIG_RENDERER_WEBGPU "Enable the webgpu renderer" OFF) diff --git a/cmake/bgfx/bgfx.cmake b/cmake/bgfx/bgfx.cmake index bb859ed7..9e904fca 100755 --- a/cmake/bgfx/bgfx.cmake +++ b/cmake/bgfx/bgfx.cmake @@ -85,6 +85,10 @@ if(NOT ${BGFX_CONFIG_DEFAULT_MAX_ENCODERS} STREQUAL "") ) endif() +if(BGFX_WITH_WAYLAND) + target_compile_definitions(bgfx PRIVATE "WL_EGL_PLATFORM=1") +endif() + set(BGFX_CONFIG_OPTIONS "") list( APPEND