Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Rauch <Rauch.Christian@gmx.de>2021-07-31 00:03:12 +0300
committerChristian Rauch <Rauch.Christian@gmx.de>2021-08-14 23:27:25 +0300
commited1e4ab1bf3ea4e817c8a81cdee350b9adf04986 (patch)
treee5efeb2921b962e31bb4f99c3c02e4c67a92e7df
parent5c145bda212725530e7ce5cdbab2edf9de382e89 (diff)
cmake: disable WITH_GHOST_WAYLAND if any Wayland dependency is missingwayland-x11-fallback
This sets WITH_GHOST_WAYLAND to ON and auto-disables it again, if one of the required Wayland development libraries is missing. Differential Revision: D11489
-rw-r--r--CMakeLists.txt2
-rw-r--r--build_files/cmake/platform/platform_unix.cmake63
-rw-r--r--intern/ghost/CMakeLists.txt14
3 files changed, 50 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 201608a531a..ac5e977fba1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -221,7 +221,7 @@ if(UNIX AND NOT (APPLE OR HAIKU))
option(WITH_GHOST_X11 "Enable building Blender against X11 for windowing" ON)
mark_as_advanced(WITH_GHOST_X11)
- option(WITH_GHOST_WAYLAND "Enable building Blender against Wayland for windowing (under development)" OFF)
+ option(WITH_GHOST_WAYLAND "Enable building Blender against Wayland for windowing (under development)" ON)
mark_as_advanced(WITH_GHOST_WAYLAND)
endif()
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index ffdbbc3f8c5..038a9ba4dac 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -574,20 +574,55 @@ endif()
if(WITH_GHOST_WAYLAND)
find_package(PkgConfig)
- pkg_check_modules(wayland-client REQUIRED wayland-client>=1.12)
- pkg_check_modules(wayland-egl REQUIRED wayland-egl)
- pkg_check_modules(wayland-scanner REQUIRED wayland-scanner)
- pkg_check_modules(xkbcommon REQUIRED xkbcommon)
- pkg_check_modules(wayland-cursor REQUIRED wayland-cursor)
- pkg_check_modules(dbus REQUIRED dbus-1)
-
- list(APPEND PLATFORM_LINKLIBS
- ${wayland-client_LINK_LIBRARIES}
- ${wayland-egl_LINK_LIBRARIES}
- ${xkbcommon_LINK_LIBRARIES}
- ${wayland-cursor_LINK_LIBRARIES}
- ${dbus_LINK_LIBRARIES}
- )
+ pkg_check_modules(wayland-client QUIET wayland-client>=1.12)
+ pkg_check_modules(wayland-egl QUIET wayland-egl)
+ pkg_check_modules(wayland-scanner QUIET wayland-scanner)
+ pkg_check_modules(wayland-cursor QUIET wayland-cursor)
+ pkg_check_modules(xkbcommon QUIET xkbcommon)
+ pkg_check_modules(dbus QUIET dbus-1)
+ pkg_check_modules(wayland-protocols QUIET wayland-protocols>=1.15)
+
+ if (${wayland-protocols_FOUND})
+ pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
+ else()
+ find_path(WAYLAND_PROTOCOLS_DIR
+ NAMES unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
+ PATH_SUFFIXES share/wayland-protocols
+ )
+ endif()
+
+ if(NOT wayland-client_FOUND)
+ message(STATUS "wayland-client not found, disabling WITH_GHOST_WAYLAND")
+ set(WITH_GHOST_WAYLAND OFF)
+ elseif(NOT wayland-egl_FOUND)
+ message(STATUS "wayland-egl not found, disabling WITH_GHOST_WAYLAND")
+ set(WITH_GHOST_WAYLAND OFF)
+ elseif(NOT wayland-scanner_FOUND)
+ message(STATUS "wayland-scanner not found, disabling WITH_GHOST_WAYLAND")
+ set(WITH_GHOST_WAYLAND OFF)
+ elseif(NOT wayland-cursor_FOUND)
+ message(STATUS "wayland-cursor not found, disabling WITH_GHOST_WAYLAND")
+ set(WITH_GHOST_WAYLAND OFF)
+ elseif(NOT xkbcommon_FOUND)
+ message(STATUS "xkbcommon not found, disabling WITH_GHOST_WAYLAND")
+ set(WITH_GHOST_WAYLAND OFF)
+ elseif(NOT dbus_FOUND)
+ message(STATUS "dbus not found, disabling WITH_GHOST_WAYLAND")
+ set(WITH_GHOST_WAYLAND OFF)
+ elseif(NOT EXISTS ${WAYLAND_PROTOCOLS_DIR})
+ message(STATUS "wayland-protocols not found, disabling WITH_GHOST_WAYLAND")
+ set(WITH_GHOST_WAYLAND OFF)
+ endif()
+
+ if(WITH_GHOST_WAYLAND)
+ list(APPEND PLATFORM_LINKLIBS
+ ${wayland-client_LINK_LIBRARIES}
+ ${wayland-egl_LINK_LIBRARIES}
+ ${xkbcommon_LINK_LIBRARIES}
+ ${wayland-cursor_LINK_LIBRARIES}
+ ${dbus_LINK_LIBRARIES}
+ )
+ endif()
endif()
if(WITH_GHOST_X11)
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
index 76cac1049fb..83686fe9cc0 100644
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@ -306,20 +306,6 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
- pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
- if (${wayland-protocols_FOUND})
- pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
- else()
- find_path(WAYLAND_PROTOCOLS_DIR
- NAMES unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
- PATH_SUFFIXES share/wayland-protocols
- )
- endif()
-
- if (NOT EXISTS ${WAYLAND_PROTOCOLS_DIR})
- message(FATAL_ERROR "path to wayland-protocols not found")
- endif()
-
# Generate protocols bindings.
macro(generate_protocol_bindings NAME PROT_DEF)
add_custom_command(