From 9afbf9a77245d77de2cab7357c87575fbf7af313 Mon Sep 17 00:00:00 2001 From: Deve Date: Sun, 7 Jan 2018 21:11:37 +0100 Subject: [PATCH] Don't return fatal error if wayland libraries are not found --- lib/irrlicht/CMakeLists.txt | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/lib/irrlicht/CMakeLists.txt b/lib/irrlicht/CMakeLists.txt index 0e403425c..e99e926ee 100644 --- a/lib/irrlicht/CMakeLists.txt +++ b/lib/irrlicht/CMakeLists.txt @@ -31,24 +31,31 @@ if(NOT SERVER_ONLY) endif() endif() - if(ENABLE_WAYLAND_DEVICE) - find_package(Wayland REQUIRED) - include_directories(${WAYLAND_INCLUDE_DIR}) + if(USE_GLES2 OR ENABLE_WAYLAND_DEVICE) + find_package(EGL) - if(NOT WAYLAND_FOUND) - message(FATAL_ERROR "Wayland not found.") + if(EGL_FOUND) + include_directories(${EGL_INCLUDE_DIR}) + else() + if(USE_GLES2) + message(FATAL_ERROR "EGL not found.") + elseif(ENABLE_WAYLAND_DEVICE) + message(WARNING "EGL not found. Disable wayland support.") + set(ENABLE_WAYLAND_DEVICE OFF) + endif() endif() - - add_definitions(-D_IRR_COMPILE_WITH_WAYLAND_DEVICE_) endif() - if(USE_GLES2 OR ENABLE_WAYLAND_DEVICE) - find_package(EGL REQUIRED) - include_directories(${EGL_INCLUDE_DIR}) + if(ENABLE_WAYLAND_DEVICE) + find_package(Wayland) - if(NOT EGL_FOUND) - message(FATAL_ERROR "EGL not found.") - endif() + if(WAYLAND_FOUND) + include_directories(${WAYLAND_INCLUDE_DIR}) + add_definitions(-D_IRR_COMPILE_WITH_WAYLAND_DEVICE_) + else() + message(WARNING "Wayland not found. Disable wayland support.") + set(ENABLE_WAYLAND_DEVICE OFF) + endif() endif() else() add_definitions(-DNO_IRR_COMPILE_WITH_OPENGL_)