On systems we run against Mir we also need to build against it
This commit is contained in:
parent
17bdff54c2
commit
53b8071e6a
3 changed files with 21 additions and 2 deletions
|
|
@ -67,6 +67,10 @@ pkg_check_modules(SDL2 sdl2 REQUIRED)
|
|||
pkg_check_modules(DBUS_CPP dbus-cpp REQUIRED)
|
||||
pkg_check_modules(DBUS dbus-1 REQUIRED)
|
||||
pkg_check_modules(LXC lxc REQUIRED)
|
||||
pkg_check_modules(MIRCLIENT mirclient)
|
||||
if (MIRCLIENT_FOUND)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMIR_SUPPORT")
|
||||
endif()
|
||||
|
||||
#####################################################################
|
||||
# Enable code coverage calculation with gcov/gcovr/lcov
|
||||
|
|
|
|||
|
|
@ -8,9 +8,11 @@ include_directories(
|
|||
${DBUS_INCLUDE_DIRS}
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
${LXC_INCLUDE_DIRS}
|
||||
${MIRCLIENT_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/external
|
||||
${CMAKE_SOURCE_DIR}/external/process-cpp-minimal/include
|
||||
${CMAKE_SOURCE_DIR}/external/android-emugl/shared
|
||||
${CMAKE_SOURCE_DIR}/external/android-emugl/host/include
|
||||
|
|
@ -205,6 +207,8 @@ target_link_libraries(anbox-core
|
|||
${SDL2_LIBRARIES}
|
||||
${LXC_LDFLAGS}
|
||||
${LXC_LIBRARIES}
|
||||
${MIRCLIENT_LDFLAGS}
|
||||
${MIRCLIENT_LIBRARIES}
|
||||
pthread
|
||||
process-cpp
|
||||
emugl_common
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@
|
|||
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
#if defined(MIR_SUPPORT)
|
||||
#include <mir_toolkit/mir_client_library.h>
|
||||
#endif
|
||||
|
||||
#include <SDL_syswm.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
|
@ -58,10 +62,17 @@ Window::Window(const std::shared_ptr<Renderer> &renderer,
|
|||
SDL_GetWindowWMInfo(window_, &info);
|
||||
switch (info.subsystem) {
|
||||
case SDL_SYSWM_X11:
|
||||
native_display_ =
|
||||
static_cast<EGLNativeDisplayType>(info.info.x11.display);
|
||||
native_display_ = static_cast<EGLNativeDisplayType>(info.info.x11.display);
|
||||
native_window_ = static_cast<EGLNativeWindowType>(info.info.x11.window);
|
||||
break;
|
||||
#if defined(MIR_SUPPORT)
|
||||
case SDL_SYSWM_MIR: {
|
||||
native_display_ = static_cast<EGLNativeDisplayType>(mir_connection_get_egl_native_display(info.info.mir.connection));
|
||||
auto buffer_stream = mir_surface_get_buffer_stream(info.info.mir.surface);
|
||||
native_window_ = reinterpret_cast<EGLNativeWindowType>(mir_buffer_stream_get_egl_native_window(buffer_stream));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
ERROR("Unknown subsystem (%d)", info.subsystem);
|
||||
BOOST_THROW_EXCEPTION(std::runtime_error("SDL subsystem not suported"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue