From 85a46e42bd12a0973a22b48785b6c878b5bc58d6 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Mon, 4 Mar 2024 15:59:26 -0300 Subject: [PATCH] CMake: Remove USE_WAYLAND option (#3851) * CMake: Remove USE_WAYLAND option * Consistency fix * Fix oversight --- CMakeLists.txt | 6 ++++++ CMakeOptions.txt | 7 ++++--- cmake/GlfwImport.cmake | 1 - 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce2de578..57719691 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,12 @@ include(CMakeOptions.txt) # Enforces a few environment and compiler configurations include(BuildOptions) +if (UNIX AND NOT APPLE) + if (NOT GLFW_BUILD_WAYLAND AND NOT GLFW_BUILD_X11) + MESSAGE(FATAL_ERROR "Cannot disable both Wayland and X11") + endif() +endif() + # Main sources directory (the second parameter sets the output directory name to raylib) add_subdirectory(src raylib) diff --git a/CMakeOptions.txt b/CMakeOptions.txt index 68468c07..2c58cd5c 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -20,9 +20,10 @@ option(MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" OFF) cmake_dependent_option(USE_AUDIO "Build raylib with audio module" ON CUSTOMIZE_BUILD ON) enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one") -if(UNIX AND NOT APPLE) - option(USE_WAYLAND "Use Wayland for window creation" OFF) -endif() + +# GLFW build options +option(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" ON) +option(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON) option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF) set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option") diff --git a/cmake/GlfwImport.cmake b/cmake/GlfwImport.cmake index 2395343c..4a5ef8c6 100644 --- a/cmake/GlfwImport.cmake +++ b/cmake/GlfwImport.cmake @@ -16,7 +16,6 @@ if(NOT glfw3_FOUND AND NOT USE_EXTERNAL_GLFW STREQUAL "ON" AND "${PLATFORM}" MAT set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) - set(GLFW_BUILD_WAYLAND ${USE_WAYLAND} CACHE BOOL "" FORCE) set(GLFW_LIBRARY_TYPE "OBJECT" CACHE STRING "" FORCE)