From 91faef6877d35998248ec35dc61e39633995ef72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B5=A9=E9=94=90?= Date: Fri, 4 Nov 2022 17:21:33 +0800 Subject: [PATCH 1/6] chore(wayland) : accelerate damage updates, reduce unnecessary cycles --- wayland/wayland.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/wayland/wayland.c b/wayland/wayland.c index 7cbff15..2df8d23 100644 --- a/wayland/wayland.c +++ b/wayland/wayland.c @@ -1957,32 +1957,33 @@ static void _lv_wayland_flush(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv return; } +#if LV_COLOR_DEPTH == 1 int32_t x; int32_t y; - for (y = area->y1; y <= area->y2 && y < disp_drv->ver_res; y++) { for (x = area->x1; x <= area->x2 && x < disp_drv->hor_res; x++) { int offset = (y * disp_drv->hor_res) + x; -#if (LV_COLOR_DEPTH == 32) - uint32_t * const buf = (uint32_t *)buffer->base + offset; - *buf = color_p->full; -#elif (LV_COLOR_DEPTH == 16) - uint16_t * const buf = (uint16_t *)buffer->base + offset; - *buf = color_p->full; -#elif (LV_COLOR_DEPTH == 8) - uint8_t * const buf = (uint8_t *)buffer->base + offset; - *buf = color_p->full; -#elif (LV_COLOR_DEPTH == 1) uint8_t * const buf = (uint8_t *)buffer->base + offset; *buf = ((0x07 * color_p->ch.red) << 5) | ((0x07 * color_p->ch.green) << 2) | ((0x03 * color_p->ch.blue) << 0); -#endif color_p++; } } +#else + int32_t bytes_pre_pixel = BYTES_PER_PIXEL; + int32_t x1 = area->x1, x2 = area->x2 <= disp_drv->hor_res - 1 ? area->x2 : disp_drv->hor_res - 1; + int32_t y1 = area->y1, y2 = area->y2 <= disp_drv->ver_res - 1 ? area->y2 : disp_drv->ver_res - 1; + int32_t act_w = x2 - x1 + 1; + + for (int y = y1; y <= y2; y++) + { + lv_memcpy((uint8_t *)buffer->base + ((y * disp_drv->hor_res + x1) * bytes_pre_pixel), color_p, act_w * bytes_pre_pixel); + color_p += act_w; + } +#endif /* LV_COLOR_DEPTH == 1 */ wl_surface_damage(window->body->surface, area->x1, area->y1, (area->x2 - area->x1 + 1), (area->y2 - area->y1 + 1)); From f76a9a2aadceaa5997824bae2166a6692c90a571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B5=A9=E9=94=90?= Date: Mon, 7 Nov 2022 08:43:47 +0800 Subject: [PATCH 2/6] chore(wayland) : Increase code robustness --- wayland/wayland.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/wayland/wayland.c b/wayland/wayland.c index 2df8d23..064a45c 100644 --- a/wayland/wayland.c +++ b/wayland/wayland.c @@ -1957,7 +1957,22 @@ static void _lv_wayland_flush(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv return; } -#if LV_COLOR_DEPTH == 1 +#if (LV_COLOR_DEPTH == BYTES_PER_PIXEL * 8) /* memory align */ \ + && !(LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8) /* not RGB332 */ + int32_t bytes_pre_pixel = BYTES_PER_PIXEL; + int32_t x1 = area->x1, x2 = area->x2 <= disp_drv->hor_res - 1 ? area->x2 : disp_drv->hor_res - 1; + int32_t y1 = area->y1, y2 = area->y2 <= disp_drv->ver_res - 1 ? area->y2 : disp_drv->ver_res - 1; + int32_t act_w = x2 - x1 + 1; + + for (int y = y1; y <= y2; y++) + { + lv_memcpy((uint8_t *)buffer->base + ((y * disp_drv->hor_res + x1) * bytes_pre_pixel), color_p, act_w * bytes_pre_pixel); + color_p += act_w; + } +#else +#if !(LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8) +#error "Unsupport LV_COLOR_DEPTH, support LV_COLOR_DEPTH: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)" +#endif int32_t x; int32_t y; for (y = area->y1; y <= area->y2 && y < disp_drv->ver_res; y++) @@ -1972,18 +1987,7 @@ static void _lv_wayland_flush(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv color_p++; } } -#else - int32_t bytes_pre_pixel = BYTES_PER_PIXEL; - int32_t x1 = area->x1, x2 = area->x2 <= disp_drv->hor_res - 1 ? area->x2 : disp_drv->hor_res - 1; - int32_t y1 = area->y1, y2 = area->y2 <= disp_drv->ver_res - 1 ? area->y2 : disp_drv->ver_res - 1; - int32_t act_w = x2 - x1 + 1; - - for (int y = y1; y <= y2; y++) - { - lv_memcpy((uint8_t *)buffer->base + ((y * disp_drv->hor_res + x1) * bytes_pre_pixel), color_p, act_w * bytes_pre_pixel); - color_p += act_w; - } -#endif /* LV_COLOR_DEPTH == 1 */ +#endif wl_surface_damage(window->body->surface, area->x1, area->y1, (area->x2 - area->x1 + 1), (area->y2 - area->y1 + 1)); From c30d09c44f8c12ce10d49056f6b2b42f6ed5ca44 Mon Sep 17 00:00:00 2001 From: wanghaorui <1905811497@qq.com> Date: Wed, 9 Nov 2022 19:27:30 +0800 Subject: [PATCH 3/6] chore(wayland) : only use `lv_memcpy` when lv color depth equal to shm color depth --- wayland/wayland.c | 104 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 73 insertions(+), 31 deletions(-) diff --git a/wayland/wayland.c b/wayland/wayland.c index 064a45c..b29ac15 100644 --- a/wayland/wayland.c +++ b/wayland/wayland.c @@ -39,9 +39,6 @@ /********************* * DEFINES *********************/ - -#define BYTES_PER_PIXEL ((LV_COLOR_DEPTH + 7) / 8) - #if LV_WAYLAND_CLIENT_SIDE_DECORATIONS #define TITLE_BAR_HEIGHT 24 #define BORDER_SIZE 2 @@ -232,6 +229,7 @@ struct window int width; int height; + int bits_per_pixel; bool resize_pending; int resize_width; @@ -299,6 +297,38 @@ static void shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) } } +static int get_shm_format_bits_per_pixel(uint32_t format) +{ + int bits_per_pixel = 0; + switch (format) + { +#if (LV_COLOR_DEPTH == 32) + case WL_SHM_FORMAT_ARGB8888: + bits_per_pixel = 32; + break; + case WL_SHM_FORMAT_XRGB8888: + bits_per_pixel = 32; + break; +#elif (LV_COLOR_DEPTH == 16) + case WL_SHM_FORMAT_RGB565: + bits_per_pixel = 16; + break; +#elif (LV_COLOR_DEPTH == 8) + case WL_SHM_FORMAT_RGB332: + bits_per_pixel = 8; + break; +#elif (LV_COLOR_DEPTH == 1) + case WL_SHM_FORMAT_RGB332: + bits_per_pixel = 8; + break; +#endif + default: + break; + } + + return bits_per_pixel; +} + static const struct wl_shm_listener shm_listener = { shm_format }; @@ -1275,7 +1305,9 @@ static bool initialize_buffer(struct window *window, struct buffer_hdl *buffer_h int ret; long sz = sysconf(_SC_PAGESIZE); - buffer_hdl->size = (((width * height * BYTES_PER_PIXEL) + sz - 1) / sz) * sz; + window->bits_per_pixel = get_shm_format_bits_per_pixel(app->format); + + buffer_hdl->size = (((width * height * window->bits_per_pixel / 8) + sz - 1) / sz) * sz; LV_LOG_TRACE("initializing buffer %dx%d (alloc size: %d)", width, height, buffer_hdl->size); @@ -1335,7 +1367,7 @@ static bool initialize_buffer(struct window *window, struct buffer_hdl *buffer_h buffer_hdl->wl_buffer = wl_shm_pool_create_buffer(allocator->shm_pool, allocator->shm_mem_size - allocator->shm_file_free_size, width, height, - width * BYTES_PER_PIXEL, + width * window->bits_per_pixel / 8, app->format); if (!buffer_hdl->wl_buffer) { @@ -1956,38 +1988,48 @@ static void _lv_wayland_flush(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv lv_disp_flush_ready(disp_drv); return; } - -#if (LV_COLOR_DEPTH == BYTES_PER_PIXEL * 8) /* memory align */ \ - && !(LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8) /* not RGB332 */ - int32_t bytes_pre_pixel = BYTES_PER_PIXEL; - int32_t x1 = area->x1, x2 = area->x2 <= disp_drv->hor_res - 1 ? area->x2 : disp_drv->hor_res - 1; - int32_t y1 = area->y1, y2 = area->y2 <= disp_drv->ver_res - 1 ? area->y2 : disp_drv->ver_res - 1; - int32_t act_w = x2 - x1 + 1; - - for (int y = y1; y <= y2; y++) + + if (LV_COLOR_DEPTH == window->bits_per_pixel && LV_COLOR_DEPTH != 1 && LV_COLOR_DEPTH != 8) { - lv_memcpy((uint8_t *)buffer->base + ((y * disp_drv->hor_res + x1) * bytes_pre_pixel), color_p, act_w * bytes_pre_pixel); - color_p += act_w; + int32_t bytes_pre_pixel = window->bits_per_pixel / 8; + int32_t x1 = area->x1, x2 = area->x2 <= disp_drv->hor_res - 1 ? area->x2 : disp_drv->hor_res - 1; + int32_t y1 = area->y1, y2 = area->y2 <= disp_drv->ver_res - 1 ? area->y2 : disp_drv->ver_res - 1; + int32_t act_w = x2 - x1 + 1; + + for (int y = y1; y <= y2; y++) + { + lv_memcpy((uint8_t *)buffer->base + ((y * disp_drv->hor_res + x1) * bytes_pre_pixel), color_p, act_w * bytes_pre_pixel); + color_p += act_w; + } } -#else -#if !(LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8) -#error "Unsupport LV_COLOR_DEPTH, support LV_COLOR_DEPTH: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)" -#endif - int32_t x; - int32_t y; - for (y = area->y1; y <= area->y2 && y < disp_drv->ver_res; y++) + else { - for (x = area->x1; x <= area->x2 && x < disp_drv->hor_res; x++) + int32_t x; + int32_t y; + for (y = area->y1; y <= area->y2 && y < disp_drv->ver_res; y++) { - int offset = (y * disp_drv->hor_res) + x; - uint8_t * const buf = (uint8_t *)buffer->base + offset; - *buf = ((0x07 * color_p->ch.red) << 5) | - ((0x07 * color_p->ch.green) << 2) | - ((0x03 * color_p->ch.blue) << 0); - color_p++; + for (x = area->x1; x <= area->x2 && x < disp_drv->hor_res; x++) + { + int offset = (y * disp_drv->hor_res) + x; +#if (LV_COLOR_DEPTH == 32) + uint32_t * const buf = (uint32_t *)buffer->base + offset; + *buf = color_p->full; +#elif (LV_COLOR_DEPTH == 16) + uint16_t * const buf = (uint16_t *)buffer->base + offset; + *buf = color_p->full; +#elif (LV_COLOR_DEPTH == 8) + uint8_t * const buf = (uint8_t *)buffer->base + offset; + *buf = color_p->full; +#elif (LV_COLOR_DEPTH == 1) + uint8_t * const buf = (uint8_t *)buffer->base + offset; + *buf = ((0x07 * color_p->ch.red) << 5) | + ((0x07 * color_p->ch.green) << 2) | + ((0x03 * color_p->ch.blue) << 0); +#endif + color_p++; + } } } -#endif wl_surface_damage(window->body->surface, area->x1, area->y1, (area->x2 - area->x1 + 1), (area->y2 - area->y1 + 1)); From 66abc2c306804e13a8a0fd7f4596d00f1cbfa5a8 Mon Sep 17 00:00:00 2001 From: wanghaorui <1905811497@qq.com> Date: Sat, 12 Nov 2022 16:18:31 +0800 Subject: [PATCH 4/6] refactor(cmake) : remove dependence of wayland when not use it [how] 1. move wayland related Cmake to `cmake/wayland_driver.cmake` 2. use option to choose whether build or not wayland 3. add build directory to git ignore --- .gitignore | 4 ++- CMakeLists.txt | 13 ++++++-- cmake/wayland_driver.cmake | 61 ++++++++++++++++++++++++++++++++++++++ wayland/CMakeLists.txt | 39 ------------------------ wayland/wayland.c | 6 +--- 5 files changed, 75 insertions(+), 48 deletions(-) create mode 100644 cmake/wayland_driver.cmake delete mode 100644 wayland/CMakeLists.txt diff --git a/.gitignore b/.gitignore index fd73aaa..c7a56ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ **/*.o -**/*.d \ No newline at end of file +**/*.d + +/build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index fadccaa..3cc8559 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,10 @@ project(lv_drivers HOMEPAGE_URL https://github.com/lvgl/lv_drivers/) # Option to build as shared library (as opposed to static), default: OFF option(BUILD_SHARED_LIBS "Build shared as library (as opposed to static)" OFF) +option(BUILD_USE_WAYLAND "Build the Wayland driver" OFF) + +# Append our module directory to CMake +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) file(GLOB_RECURSE SOURCES ./*.c) @@ -18,9 +22,12 @@ add_library(lvgl::drivers ALIAS lv_drivers) target_include_directories(lv_drivers SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -find_package(PkgConfig) -pkg_check_modules(PKG_WAYLAND wayland-client wayland-cursor wayland-protocols xkbcommon) -target_link_libraries(lv_drivers PUBLIC lvgl ${PKG_WAYLAND_LIBRARIES}) +target_link_libraries(lv_drivers PUBLIC lvgl) + +if (BUILD_USE_WAYLAND) + include(wayland_driver) + target_link_libraries(lv_drivers PUBLIC ${PKG_WAYLAND_LIBRARIES}) +endif() if("${LIB_INSTALL_DIR}" STREQUAL "") set(LIB_INSTALL_DIR "lib") diff --git a/cmake/wayland_driver.cmake b/cmake/wayland_driver.cmake new file mode 100644 index 0000000..4578893 --- /dev/null +++ b/cmake/wayland_driver.cmake @@ -0,0 +1,61 @@ +project(lv_wayland) + +option(USE_WL_SHELL "use wl shell (discard, no recommend)" OFF) +option(USE_XDG_SHELL "use xdg shell" OFF) +option(USE_WAYLAND_TIMER_HANDLER "" OFF) + +set(WAYLAND_SCANNER_EXECUTABLE) + +macro(wayland_generate protocol_xml_file output_dir) + + if(NOT EXISTS ${protocol_xml_file}) + message(FATAL_ERROR "-- protocol XML file not found: " ${protocol_xml_file}) + endif() + + get_filename_component(output_file_base ${protocol_xml_file} NAME_WE) + set(xdg_shell_file "${output_dir}/wayland-${output_file_base}-client-protocol") + message("-- generating ${xdg_shell_file}.h") + execute_process(COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header "${protocol_xml_file}" "${xdg_shell_file}.h") + message("-- generating ${xdg_shell_file}.c") + execute_process(COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_xml_file}" "${xdg_shell_file}.c") +endmacro() + +if (NOT USE_WL_SHELL AND USE_XDG_SHELL) + message(FATAL_ERROR "Please select at least one of USE_WL_SHELL and USE_XDG_SHELL (that is, can both select)") +endif() + +if (USE_WL_SHELL) + add_definitions(-DLV_WAYLAND_WL_SHELL=1) +endif() + +if (USE_XDG_SHELL) + add_definitions(-DLV_WAYLAND_XDG_SHELL=1) +endif() + +if (USE_WAYLAND_TIMER_HANDLER) + add_definitions(-DLV_WAYLAND_TIMER_HANDLER=1) +endif() + +add_definitions(-DUSE_WAYLAND=1) + +# wayland driver dependences +find_package(PkgConfig) +pkg_check_modules(PKG_WAYLAND wayland-client wayland-cursor wayland-protocols xkbcommon) +message("-- Find wayland dependences : ${PKG_WAYLAND_LIBRARIES}") + +if (USE_XDG_SHELL) + message("-- select xdg shell") + find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) + pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols>=1.15) + if (NOT EXISTS WAYLAND_PROTOCOLS_BASE) # may be you need to specify wayland protocol path for cross compile + pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir) + endif() + message("-- find wayland scanner : ${WAYLAND_SCANNER_EXECUTABLE}") + message("-- find wayland protocol path : ${WAYLAND_PROTOCOLS_BASE}") + + # use wayland scanner with xdg-shell.xml to generate xgd protocol source and header files + set(WAYLAND_PROTOCOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/wayland/protocols") + file(MAKE_DIRECTORY ${WAYLAND_PROTOCOLS_DIR}) + wayland_generate("${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml" ${WAYLAND_PROTOCOLS_DIR}) + include_directories(${WAYLAND_PROTOCOLS_DIR}) +endif() \ No newline at end of file diff --git a/wayland/CMakeLists.txt b/wayland/CMakeLists.txt deleted file mode 100644 index 6ac6505..0000000 --- a/wayland/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(lv_wayland) - -find_package(PkgConfig) -pkg_check_modules(wayland-client REQUIRED wayland-client) -pkg_check_modules(wayland-cursor REQUIRED wayland-cursor) -pkg_check_modules(xkbcommon REQUIRED xkbcommon) - -# Wayland protocols -find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) -pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols>=1.15) -pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir) - -macro(wayland_generate protocol_xml_file output_dir target) - get_filename_component(output_file_base ${protocol_xml_file} NAME_WE) - set(output_file_noext "${output_dir}/wayland-${output_file_base}-client-protocol") - add_custom_command(OUTPUT "${output_file_noext}.h" - COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header "${protocol_xml_file}" "${output_file_noext}.h" - DEPENDS "${protocol_xml_file}" - VERBATIM) - - add_custom_command(OUTPUT "${output_file_noext}.c" - COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_xml_file}" "${output_file_noext}.c" - DEPENDS "${protocol_xml_file}" - VERBATIM) - - if(NOT EXISTS ${protocol_xml_file}) - message("Protocol XML file not found: " ${protocol_xml_file}) - else() - set_property(TARGET ${target} APPEND PROPERTY SOURCES "${output_file_noext}.h" "${output_file_noext}.c") - endif() -endmacro() - -set(WAYLAND_PROTOCOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/protocols") -file(MAKE_DIRECTORY ${WAYLAND_PROTOCOLS_DIR}) - -add_custom_target(generate_protocols ALL) - -wayland_generate("${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml" ${WAYLAND_PROTOCOLS_DIR} generate_protocols) diff --git a/wayland/wayland.c b/wayland/wayland.c index b29ac15..5657722 100644 --- a/wayland/wayland.c +++ b/wayland/wayland.c @@ -28,12 +28,8 @@ #include #include -#if !(LV_WAYLAND_XDG_SHELL || LV_WAYLAND_WL_SHELL) -#error "Please select at least one shell integration for Wayland driver" -#endif - #if LV_WAYLAND_XDG_SHELL -#include "protocols/wayland-xdg-shell-client-protocol.h" +#include "wayland-xdg-shell-client-protocol.h" #endif /********************* From 67f978c51937bd80a5402a00f92a4837e2c06815 Mon Sep 17 00:00:00 2001 From: wanghaorui <1905811497@qq.com> Date: Sat, 12 Nov 2022 16:37:15 +0800 Subject: [PATCH 5/6] chore(wayland) : move `include(wayland_driver)` before `file(GLOB_RECURSE SOURCES ./*.c)` --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cc8559..f4ccd92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,10 @@ option(BUILD_USE_WAYLAND "Build the Wayland driver" OFF) # Append our module directory to CMake list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +if (BUILD_USE_WAYLAND) + include(wayland_driver) +endif() + file(GLOB_RECURSE SOURCES ./*.c) if (BUILD_SHARED_LIBS) @@ -25,7 +29,6 @@ target_include_directories(lv_drivers SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(lv_drivers PUBLIC lvgl) if (BUILD_USE_WAYLAND) - include(wayland_driver) target_link_libraries(lv_drivers PUBLIC ${PKG_WAYLAND_LIBRARIES}) endif() From a05807059aefb102b7fd0d5b028f5159683ddae4 Mon Sep 17 00:00:00 2001 From: wanghaorui <1905811497@qq.com> Date: Sun, 13 Nov 2022 19:58:57 +0800 Subject: [PATCH 6/6] bufgix(wayland) : enabling only XDG shell would trigger the FATAL_ERROR chore(wayland) : improve some descriptions --- cmake/wayland_driver.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/wayland_driver.cmake b/cmake/wayland_driver.cmake index 730f241..f142958 100644 --- a/cmake/wayland_driver.cmake +++ b/cmake/wayland_driver.cmake @@ -1,7 +1,7 @@ project(lv_wayland) -option(USE_WL_SHELL "use wl shell (discard, no recommend)" OFF) -option(USE_XDG_SHELL "use xdg shell" OFF) +option(USE_WL_SHELL "use wl_shell (deprecated, not recommended)" OFF) +option(USE_XDG_SHELL "use xdg_shell" OFF) option(USE_WAYLAND_TIMER_HANDLER "" OFF) set(WAYLAND_SCANNER_EXECUTABLE) @@ -20,8 +20,8 @@ macro(wayland_generate protocol_xml_file output_dir) execute_process(COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_xml_file}" "${xdg_shell_file}.c") endmacro() -if (NOT USE_WL_SHELL AND USE_XDG_SHELL) - message(FATAL_ERROR "Please select at least one of USE_WL_SHELL and USE_XDG_SHELL (that is, can both select)") +if (NOT USE_WL_SHELL AND NOT USE_XDG_SHELL) + message(FATAL_ERROR "Please select at least one of USE_WL_SHELL and USE_XDG_SHELL (multiple choices allowed)") endif() if (USE_WL_SHELL)