From c2120b8c4f31988ea4b7ff3235da12bba644f1fb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 19 Jan 2023 17:07:19 +1100 Subject: [PATCH] CMake: suppress missing-variable-declarations warnings with Clang Code generated by wayland-scanner contained missing declarations. --- intern/ghost/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index fd706d758a3..ac7dd6ca5cf 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -360,6 +360,15 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND) COMMAND ${WAYLAND_SCANNER} private-code ${PROT_DEF} ${INC_DST}/${_name}-client-protocol.c DEPENDS ${INC_DST}/${_name}-client-protocol.h ) + + if(CMAKE_C_COMPILER_ID MATCHES "Clang") + # Prevent warnings/failure to compile with generated `WL_PRIVATE` declarations. + set_source_files_properties( + "${INC_DST}/${_name}-client-protocol.c" + PROPERTIES COMPILE_FLAGS "-Wno-missing-variable-declarations" + ) + endif() + list(APPEND SRC ${INC_DST}/${_name}-client-protocol.c ${INC_DST}/${_name}-client-protocol.h