summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/onevpl/onevpl/0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-multimedia/onevpl/onevpl/0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch')
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch98
1 files changed, 0 insertions, 98 deletions
diff --git a/recipes-multimedia/onevpl/onevpl/0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch b/recipes-multimedia/onevpl/onevpl/0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch
deleted file mode 100644
index 6fab79e5..00000000
--- a/recipes-multimedia/onevpl/onevpl/0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch
+++ /dev/null
@@ -1,98 +0,0 @@
1From 6ef9dd02e297ae20da422f2f3f4f298061efd6e9 Mon Sep 17 00:00:00 2001
2From: "Ung, Teng En" <teng.en.ung@intel.com>
3Date: Fri, 15 Oct 2021 11:55:13 +0000
4Subject: [PATCH 1/3] samples: Addin wayland-scanner auto generate on cmake.
5
6Upstream-Status: Submitted
7innersource PR #269
8
9---
10 tools/legacy/sample_common/CMakeLists.txt | 21 ++++++++++
11 .../legacy/sample_misc/wayland/CMakeLists.txt | 39 +++++++++++++++++++
12 2 files changed, 60 insertions(+)
13
14diff --git a/tools/legacy/sample_common/CMakeLists.txt b/tools/legacy/sample_common/CMakeLists.txt
15index 0ff83aa4..0ed8b390 100644
16--- a/tools/legacy/sample_common/CMakeLists.txt
17+++ b/tools/legacy/sample_common/CMakeLists.txt
18@@ -92,6 +92,27 @@ if(UNIX)
19 target_include_directories(
20 ${TARGET}
21 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../sample_misc/wayland/include)
22+
23+ pkg_check_modules(PKG_WAYLAND_SCANNER "wayland-scanner>=1.15")
24+ pkg_check_modules(PKG_WAYLAND_PROTCOLS "wayland-protocols>=1.15")
25+
26+ if(PKG_WAYLAND_SCANNER_FOUND AND PKG_WAYLAND_PROTCOLS_FOUND)
27+ pkg_get_variable(WAYLAND_PROTOCOLS_PATH wayland-protocols pkgdatadir)
28+ if(WAYLAND_PROTOCOLS_PATH)
29+ find_file(
30+ WAYLAND_LINUX_DMABUF_XML_PATH linux-dmabuf-unstable-v1.xml
31+ PATHS ${WAYLAND_PROTOCOLS_PATH}/unstable/linux-dmabuf
32+ NO_DEFAULT_PATH)
33+ endif()
34+ endif()
35+
36+ if(WAYLAND_LINUX_DMABUF_XML_PATH)
37+ target_compile_definitions(
38+ ${TARGET} PUBLIC -DWAYLAND_LINUX_DMABUF_SUPPORT)
39+ target_include_directories(
40+ ${TARGET}
41+ PUBLIC ${CMAKE_BINARY_DIR}/tools/legacy/sample_misc/wayland)
42+ endif()
43 else()
44 message(
45 WARNING
46diff --git a/tools/legacy/sample_misc/wayland/CMakeLists.txt b/tools/legacy/sample_misc/wayland/CMakeLists.txt
47index 1fe98da4..01e6029b 100644
48--- a/tools/legacy/sample_misc/wayland/CMakeLists.txt
49+++ b/tools/legacy/sample_misc/wayland/CMakeLists.txt
50@@ -29,6 +29,45 @@ target_sources(
51 ${CMAKE_CURRENT_SOURCE_DIR}/src/listener_wayland.cpp
52 ${CMAKE_CURRENT_SOURCE_DIR}/src/wayland-drm-protocol.c)
53
54+if(PKG_WAYLAND_SCANNER_FOUND AND PKG_WAYLAND_PROTCOLS_FOUND AND WAYLAND_LINUX_DMABUF_XML_PATH)
55+ pkg_get_variable(WAYLAND_SCANNER_BIN_PATH wayland-scanner bindir)
56+ pkg_get_variable(WAYLAND_SCANNER_BIN wayland-scanner wayland_scanner)
57+
58+ if(WAYLAND_SCANNER_BIN_PATH AND WAYLAND_SCANNER_BIN)
59+ execute_process(
60+ COMMAND "${WAYLAND_SCANNER_BIN_PATH}\/${WAYLAND_SCANNER_BIN}"
61+ "client-header" "${WAYLAND_LINUX_DMABUF_XML_PATH}"
62+ "tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.h"
63+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
64+ RESULT_VARIABLE WAYLAND_SCANNER_RESULT)
65+ if (WAYLAND_SCANNER_RESULT)
66+ message(ERROR "Failed to generate linux-dmabuf-unstable-v1.h")
67+ return()
68+ endif()
69+
70+ execute_process(
71+ COMMAND "${WAYLAND_SCANNER_BIN_PATH}\/${WAYLAND_SCANNER_BIN}"
72+ "private-code" "${WAYLAND_LINUX_DMABUF_XML_PATH}"
73+ "tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.c"
74+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
75+ RESULT_VARIABLE WAYLAND_SCANNER_RESULT)
76+ if (WAYLAND_SCANNER_RESULT)
77+ message(ERROR "Failed to generate linux-dmabuf-unstable-v1.c")
78+ return()
79+ endif()
80+
81+ include_directories(
82+ ${CMAKE_BINARY_DIR}/tools/legacy/sample_misc/wayland)
83+ add_definitions(-DWAYLAND_LINUX_DMABUF_SUPPORT)
84+ target_sources(
85+ ${TARGET}
86+ PRIVATE ${CMAKE_BINARY_DIR}/tools/legacy/sample_misc/wayland/linux-dmabuf-unstable-v1.c)
87+ else()
88+ message(ERROR "Don't know how to execute wayland-scanner.")
89+ return()
90+ endif()
91+endif()
92+
93 target_link_libraries(${TARGET} sample_common wayland-client va drm drm_intel)
94
95 install(TARGETS ${TARGET} LIBRARY DESTINATION ${_TOOLS_LIB_PATH})
96--
972.31.1
98