diff options
Diffstat (limited to 'intern/ghost/CMakeLists.txt')
-rw-r--r-- | intern/ghost/CMakeLists.txt | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index 77ec307e604..76cac1049fb 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -155,6 +155,9 @@ if(WITH_HEADLESS OR WITH_GHOST_SDL) endif() elseif(APPLE AND NOT WITH_GHOST_X11) + if(WITH_INPUT_IME) + add_definitions(-DWITH_INPUT_IME) + endif() list(APPEND SRC intern/GHOST_DisplayManagerCocoa.mm intern/GHOST_SystemCocoa.mm @@ -285,16 +288,37 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND) ${dbus_INCLUDE_DIRS} ) + include(CheckSymbolExists) + set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") + check_symbol_exists(memfd_create "sys/mman.h" HAVE_MEMFD_CREATE) + if (HAVE_MEMFD_CREATE) + add_definitions(-DHAVE_MEMFD_CREATE) + endif() + list(APPEND SRC intern/GHOST_SystemWayland.cpp intern/GHOST_WindowWayland.cpp intern/GHOST_SystemWayland.h + intern/GHOST_WaylandCursorSettings.h intern/GHOST_WindowWayland.h ) pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner) - pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) + + 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) |