Merge pull request #831 from tomek-brcm/master

Fixes for embedded systems
This commit is contained in:
Sascha Willems 2021-05-08 19:24:55 +02:00 committed by GitHub
commit 6180f3d1e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_minimum_required(VERSION 3.4 FATAL_ERROR)
cmake_policy(VERSION 2.8)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
@ -75,7 +75,7 @@ ELSEIF(LINUX)
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_USE_PLATFORM_WAYLAND_KHR")
include_directories(${WAYLAND_INCLUDE_DIR})
execute_process(COMMAND ${PKG_CONFIG} --variable=pkgdatadir wayland-protocols OUTPUT_VARIABLE protocol_dir OUTPUT_STRIP_TRAILING_WHITESPACE)
pkg_get_variable(protocol_dir wayland-protocols pkgdatadir)
execute_process(COMMAND ${WAYLAND_SCANNER} client-header ${protocol_dir}/stable/xdg-shell/xdg-shell.xml ${CMAKE_BINARY_DIR}/xdg-shell-client-protocol.h
COMMAND ${WAYLAND_SCANNER} private-code ${protocol_dir}/stable/xdg-shell/xdg-shell.xml ${CMAKE_BINARY_DIR}/xdg-shell-protocol.c)
include_directories(${CMAKE_BINARY_DIR})

View file

@ -842,6 +842,7 @@ VulkanExampleBase::~VulkanExampleBase()
wl_keyboard_destroy(keyboard);
if (pointer)
wl_pointer_destroy(pointer);
if (seat)
wl_seat_destroy(seat);
xdg_wm_base_destroy(shell);
wl_compositor_destroy(compositor);
@ -2128,12 +2129,17 @@ void VulkanExampleBase::initWaylandConnection()
wl_registry_add_listener(registry, &registry_listener, this);
wl_display_dispatch(display);
wl_display_roundtrip(display);
if (!compositor || !shell || !seat)
if (!compositor || !shell)
{
std::cout << "Could not bind Wayland protocols!\n";
fflush(stdout);
exit(1);
}
if (!seat)
{
std::cout << "WARNING: Input handling not available!\n";
fflush(stdout);
}
}
void VulkanExampleBase::setSize(int width, int height)