wayland: Port to xdg-shell stable
Wayland compositors and clients are expected to support the xdg-shell stable protocol over the deprecated wl_shell protocol.
This commit is contained in:
parent
cd8b82b3fa
commit
203ea178d0
4 changed files with 97 additions and 24 deletions
|
|
@ -49,12 +49,28 @@ IF(USE_D2D_WSI)
|
|||
MESSAGE("Using direct to display extension...")
|
||||
add_definitions(-D_DIRECT2DISPLAY)
|
||||
ELSEIF(USE_WAYLAND_WSI)
|
||||
find_program(PKG_CONFIG pkg-config)
|
||||
if (NOT PKG_CONFIG)
|
||||
message(FATAL_ERROR "pkg-config binary not found")
|
||||
endif ()
|
||||
find_package(Wayland REQUIRED)
|
||||
if (NOT WAYLAND_FOUND)
|
||||
message(FATAL_ERROR "Wayland development package not found")
|
||||
endif ()
|
||||
pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols)
|
||||
if (NOT WAYLAND_PROTOCOLS_FOUND)
|
||||
message(FATAL_ERROR "Wayland protocols package not found")
|
||||
endif ()
|
||||
find_program(WAYLAND_SCANNER wayland-scanner)
|
||||
if (NOT WAYLAND_SCANNER)
|
||||
message(FATAL_ERROR "wayland-scanner binary not found")
|
||||
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)
|
||||
execute_process(COMMAND ${WAYLAND_SCANNER} client-header ${protocol_dir}/stable/xdg-shell/xdg-shell.xml xdg-shell-client-protocol.h
|
||||
COMMAND ${WAYLAND_SCANNER} private-code ${protocol_dir}/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.c)
|
||||
include_directories(${CMAKE_BINARY_DIR})
|
||||
ELSE(USE_D2D_WSI)
|
||||
find_package(XCB REQUIRED)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_USE_PLATFORM_XCB_KHR")
|
||||
|
|
@ -78,7 +94,7 @@ endif()
|
|||
|
||||
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions(-std=c++11)
|
||||
set(CXXFLAGS -std=c++11)
|
||||
|
||||
file(GLOB SOURCE *.cpp )
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue