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