From ca44056f0e808c16cfa695f8b47bd86bf6bb2a6e Mon Sep 17 00:00:00 2001 From: Benign X <1341398182@qq.com> Date: Mon, 2 Sep 2024 12:50:40 +0800 Subject: [PATCH] chore(tests): fix build break on macOS (#6773) --- tests/CMakeLists.txt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a4e8f4b1c..bd561bce0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -205,6 +205,7 @@ if(NOT (CMAKE_C_COMPILER_ID STREQUAL "MSVC")) -Werror=strict-aliasing -Wno-double-promotion -Wno-unreachable-code + -Wno-gnu-zero-variadic-macro-arguments ) else() list(APPEND COMPILE_OPTIONS @@ -329,16 +330,20 @@ if(NOT WIN32) # 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) + pkg_check_modules(wayland_client wayland-client) - link_libraries(wayland-client wayland-cursor xkbcommon) + if (wayland_client_FOUND) + pkg_check_modules(wayland-cursor REQUIRED wayland-cursor) + pkg_check_modules(xkbcommon REQUIRED xkbcommon) - # Add auto generated source required for XDG shell - include_directories("${LVGL_TEST_DIR}/wayland_protocols") - target_sources(test_common PUBLIC "wayland_protocols/wayland_xdg_shell.c") + link_libraries(wayland-client wayland-cursor xkbcommon) + # Add auto generated source required for XDG shell + include_directories("${LVGL_TEST_DIR}/wayland_protocols") + target_sources(test_common PUBLIC "wayland_protocols/wayland_xdg_shell.c") + else() + add_definitions(-DLV_USE_WAYLAND=0) + endif() endif() # libpng is required for the png test case