Skip to content

Commit

Permalink
agl-capture phase I
Browse files Browse the repository at this point in the history
-WestonCapture
-agl-capture example
-prevent reallocation of seats and outputs if allready allocated
-always include local protocols in library

Signed-off-by: Joel Winarske <[email protected]>
  • Loading branch information
jwinarske committed May 4, 2024
1 parent 6826c6c commit 7f36476
Show file tree
Hide file tree
Showing 35 changed files with 2,918 additions and 938 deletions.
26 changes: 14 additions & 12 deletions cmake/context.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,17 @@ endif ()
#
# Toolchain IPO/LTO support
#
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
check_ipo_supported(
RESULT IPO_SUPPORT_RESULT
OUTPUT IPO_SUPPORT_OUTPUT
LANGUAGES C CXX
)
if (IPO_SUPPORT_RESULT)
message(STATUS "IPO .................... supported")
else ()
message(STATUS "IPO .................... not supported: ${IPO_SUPPORT_OUTPUT}")
endif ()
if (ENABLE_LTO)
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
check_ipo_supported(
RESULT IPO_SUPPORT_RESULT
OUTPUT IPO_SUPPORT_OUTPUT
LANGUAGES C CXX
)
if (IPO_SUPPORT_RESULT)
message(STATUS "IPO .................... supported")
else ()
message(STATUS "IPO .................... not supported: ${IPO_SUPPORT_OUTPUT}")
endif ()
endif ()
6 changes: 6 additions & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
#


#
# Link Time Optimization
#
option(ENABLE_LTO "Link Time Optimization" ON)
MESSAGE(STATUS "Link Time Optimizaiton.. ${ENABLE_LTO}")

#
# Examples
#
Expand Down
8 changes: 8 additions & 0 deletions cmake/wayland-protocols.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#cmakedefine01 HAS_WAYLAND_PROTOCOL_XDG_OUTPUT_UNSTABLE_V1
#cmakedefine01 HAS_WAYLAND_PROTOCOL_XDG_DECORATION_UNSTABLE_V1
#cmakedefine01 HAS_WAYLAND_PROTOCOL_LINUX_DMABUF_V1GLOBAL
#cmakedefine01 HAS_WAYLAND_PROTOCOL_WESTON_OUTPUT_CAPTURE

#cmakedefine01 HAVE_MEMFD_CREATE
#cmakedefine01 HAVE_POSIX_FALLOCATE
Expand Down Expand Up @@ -97,4 +98,11 @@ struct zxdg_output_manager_v1;
struct zxdg_output_v1;
#endif

#if HAS_WAYLAND_PROTOCOL_WESTON_OUTPUT_CAPTURE
#include "weston-output-capture-client-protocol.h"
#else
struct weston_capture_source_v1;
struct weston_capture_v1;
#endif

#endif //INCLUDE_PROTOCOLS_H_
22 changes: 10 additions & 12 deletions cmake/wayland.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,16 @@ set(WAYLAND_PROTOCOL_SOURCES)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/protocols)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/protocols)

if (ENABLE_XDG_CLIENT)
add_protocol(${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml)
endif ()
if (ENABLE_AGL_SHELL_CLIENT)
add_protocol(${CMAKE_SOURCE_DIR}/third_party/agl/protocol/agl-shell.xml)
add_protocol(${CMAKE_SOURCE_DIR}/third_party/agl/protocol/agl-shell-desktop.xml)
add_protocol(${CMAKE_SOURCE_DIR}/third_party/agl/protocol/agl-screenshooter.xml)
endif ()
if (ENABLE_IVI_SHELL_CLIENT)
add_protocol(${CMAKE_SOURCE_DIR}/third_party/weston/protocol/ivi-application.xml)
add_protocol(${CMAKE_SOURCE_DIR}/third_party/weston/protocol/ivi-wm.xml)
endif ()
add_protocol(${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml)
add_protocol(${CMAKE_SOURCE_DIR}/third_party/agl/protocol/agl-shell.xml)
add_protocol(${CMAKE_SOURCE_DIR}/third_party/agl/protocol/agl-shell-desktop.xml)
add_protocol(${CMAKE_SOURCE_DIR}/third_party/agl/protocol/agl-screenshooter.xml)
add_protocol(${CMAKE_SOURCE_DIR}/third_party/weston/protocol/ivi-application.xml)
add_protocol(${CMAKE_SOURCE_DIR}/third_party/weston/protocol/ivi-wm.xml)

add_protocol(${CMAKE_SOURCE_DIR}/third_party/weston/protocol/weston-output-capture.xml)
message(STATUS "Weston Output Capture . ${HAS_WAYLAND_PROTOCOL_WESTON_OUTPUT_CAPTURE}")

if (ENABLE_DRM_LEASE_CLIENT)
add_protocol(${WAYLAND_PROTOCOLS_BASE}/staging/drm-lease/drm-lease-v1.xml)
endif ()
Expand Down
118 changes: 62 additions & 56 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,83 +17,89 @@
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLESv2 IMPORTED_TARGET glesv2)

if (ENABLE_XDG_CLIENT)
#
# simple-egl
#
add_executable(simple-egl simple-egl.cc)
target_include_directories(simple-egl PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)

#
# simple-egl
#
add_executable(simple-egl simple-egl.cc)
target_include_directories(simple-egl PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
target_compile_definitions(simple-egl PRIVATE EGL_NO_X11 MESA_EGL_NO_X11_HEADERS)

target_compile_definitions(simple-egl PRIVATE EGL_NO_X11 MESA_EGL_NO_X11_HEADERS)
target_link_libraries(simple-egl PRIVATE waypp wayland-gen PkgConfig::GLESv2 cxxopts::cxxopts)

target_link_libraries(simple-egl PRIVATE waypp wayland-gen PkgConfig::GLESv2 cxxopts::cxxopts)
if (IPO_SUPPORT_RESULT)
set_property(TARGET simple-egl PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()

if (IPO_SUPPORT_RESULT)
set_property(TARGET simple-egl PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
add_sanitizers(simple-egl)

add_sanitizers(simple-egl)
#
# simple-shm
#
add_executable(simple-shm simple-shm.cc)
target_include_directories(simple-shm PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)

#
# simple-shm
#
add_executable(simple-shm simple-shm.cc)
target_include_directories(simple-shm PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(simple-shm PRIVATE waypp wayland-gen cxxopts::cxxopts)

if (IPO_SUPPORT_RESULT)
set_property(TARGET simple-shm PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()

add_sanitizers(simple-shm)

#
# presentation-shm
#
if (FALSE)
add_executable(presentation-shm presentation-shm.cc)
target_include_directories(presentation-shm PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)

target_link_libraries(simple-shm PRIVATE waypp wayland-gen cxxopts::cxxopts)
target_link_libraries(presentation-shm PRIVATE waypp wayland-gen cxxopts::cxxopts)

if (IPO_SUPPORT_RESULT)
set_property(TARGET simple-shm PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
set_property(TARGET presentation-shm PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()

add_sanitizers(simple-shm)

#
# presentation-shm
#
if (FALSE)
add_executable(presentation-shm presentation-shm.cc)
target_include_directories(presentation-shm PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
add_sanitizers(presentation-shm)
endif ()

target_link_libraries(presentation-shm PRIVATE waypp wayland-gen cxxopts::cxxopts)
#
# simple-ext-protocol
#
if (HAS_WAYLAND_PROTOCOL_XDG_OUTPUT_UNSTABLE_V1)
add_executable(simple-ext-protocol simple-ext-protocol.cc)
target_include_directories(simple-ext-protocol PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)

if (IPO_SUPPORT_RESULT)
set_property(TARGET presentation-shm PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
target_link_libraries(simple-ext-protocol PRIVATE waypp wayland-gen cxxopts::cxxopts)

add_sanitizers(presentation-shm)
if (IPO_SUPPORT_RESULT)
set_property(TARGET simple-ext-protocol PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()

#
# simple-ext-protocol
#
if (HAS_WAYLAND_PROTOCOL_XDG_OUTPUT_UNSTABLE_V1)
add_executable(simple-ext-protocol simple-ext-protocol.cc)
target_include_directories(simple-ext-protocol PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
add_sanitizers(simple-ext-protocol)
endif ()

target_link_libraries(simple-ext-protocol PRIVATE waypp wayland-gen cxxopts::cxxopts)
#
# agl-simple-shm
#
add_executable(agl-simple-shm agl-simple-shm.cc)
target_include_directories(agl-simple-shm PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)

if (IPO_SUPPORT_RESULT)
set_property(TARGET simple-ext-protocol PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
target_link_libraries(agl-simple-shm PRIVATE waypp wayland-gen cxxopts::cxxopts)

add_sanitizers(simple-ext-protocol)
endif ()
if (IPO_SUPPORT_RESULT)
set_property(TARGET agl-simple-shm PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()

#
# agl-simple-shm
#
if (ENABLE_AGL_SHELL_CLIENT)
add_executable(agl-simple-shm agl-simple-shm.cc)
target_include_directories(agl-simple-shm PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
add_sanitizers(agl-simple-shm)

target_link_libraries(agl-simple-shm PRIVATE waypp wayland-gen cxxopts::cxxopts)
add_executable(agl-capture agl-capture.cc agl-capture.cc)
target_include_directories(agl-capture PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)

if (IPO_SUPPORT_RESULT)
set_property(TARGET agl-simple-shm PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
target_link_libraries(agl-capture PRIVATE waypp wayland-gen cxxopts::cxxopts)

add_sanitizers(agl-simple-shm)
endif ()
if (IPO_SUPPORT_RESULT)
set_property(TARGET agl-capture PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()

add_sanitizers(agl-capture)
Loading

0 comments on commit 7f36476

Please sign in to comment.