diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dfaf37..c1a98c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,12 @@ pkg_check_modules(SDL2_IMAGE SDL2_image REQUIRED) pkg_check_modules(DBUS dbus-1 REQUIRED) pkg_check_modules(LXC lxc REQUIRED) pkg_check_modules(PROPERTIES_CPP properties-cpp REQUIRED) + +option(ANBOX_ENABLE_WAYLAND "Enable wayland support" ON) +if (ANBOX_ENABLE_WAYLAND) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWAYLAND_SUPPORT") +endif() + pkg_check_modules(LIBSYSTEMD libsystemd REQUIRED) # FIXME mir support is currently broken due to mir's API # being broken with recent landings in Ubuntu 16.04 @@ -140,4 +146,3 @@ option(TOUCH_INPUT "Enable touch input support" OFF) if (TOUCH_INPUT) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_TOUCH_INPUT") endif() - diff --git a/src/anbox/platform/sdl/window.cpp b/src/anbox/platform/sdl/window.cpp index ede433e..a5806a9 100644 --- a/src/anbox/platform/sdl/window.cpp +++ b/src/anbox/platform/sdl/window.cpp @@ -83,10 +83,12 @@ Window::Window(const std::shared_ptr &renderer, native_display_ = static_cast(info.info.x11.display); native_window_ = static_cast(info.info.x11.window); break; +#if defined(WAYLAND_SUPPORT) case SDL_SYSWM_WAYLAND: native_display_ = static_cast(info.info.wl.display); native_window_ = reinterpret_cast(info.info.wl.surface); break; +#endif #if defined(MIR_SUPPORT) case SDL_SYSWM_MIR: { native_display_ = static_cast(mir_connection_get_egl_native_display(info.info.mir.connection));