[Bf-blender-cvs] [c2120b8c4f3] master: CMake: suppress missing-variable-declarations warnings with Clang
Campbell Barton
noreply at git.blender.org
Thu Jan 19 07:31:49 CET 2023
Commit: c2120b8c4f31988ea4b7ff3235da12bba644f1fb
Author: Campbell Barton
Date: Thu Jan 19 17:07:19 2023 +1100
Branches: master
https://developer.blender.org/rBc2120b8c4f31988ea4b7ff3235da12bba644f1fb
CMake: suppress missing-variable-declarations warnings with Clang
Code generated by wayland-scanner contained missing declarations.
===================================================================
M intern/ghost/CMakeLists.txt
===================================================================
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
More information about the Bf-blender-cvs
mailing list