CMake: suppress missing-variable-declarations warnings with Clang

Code generated by wayland-scanner contained missing declarations.
This commit is contained in:
Campbell Barton 2023-01-19 17:07:19 +11:00
parent 9676dce317
commit c2120b8c4f
1 changed files with 9 additions and 0 deletions

View File

@ -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