Cleanup: suppress template-id-cdtor GCC warnings

Ignoring from CMake didn't suppress the warnings from GPU sources
that include this header. Suppress the warning using a pragma instead.
This commit is contained in:
Campbell Barton
2024-05-27 11:57:30 +10:00
parent c3b985906d
commit db58cde877
2 changed files with 7 additions and 5 deletions

View File

@@ -388,11 +388,6 @@ endif()
if(WITH_VULKAN_BACKEND)
if(CMAKE_COMPILER_IS_GNUCC)
# Suppress CPP20 compiler warnings in GCC14+
set_source_files_properties(${VULKAN_SRC} PROPERTIES COMPILE_FLAGS "-Wno-template-id-cdtor")
endif()
if(APPLE)
list(APPEND INC_SYS
${MOLTENVK_INCLUDE_DIRS}

View File

@@ -17,6 +17,11 @@ namespace blender::gpu {
class VKContext;
class VKCommandBuffers;
#pragma GCC diagnostic push
/* CPP20 compiler warnings in GCC14+.
* Must be resolved before upgrading to a newer C++, avoid noisy warnings for now. */
#pragma GCC diagnostic ignored "-Wtemplate-id-cdtor"
/**
* In vulkan multiple commands can be in flight simultaneously.
*
@@ -183,4 +188,6 @@ template<typename Resource> class VKResourceTracker : NonCopyable {
}
};
#pragma GCC diagnostic pop
} // namespace blender::gpu