From a8e37f967bec33dfe131a4eb8f8739fa2bf6d98c Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 3 Feb 2020 15:38:06 -0800 Subject: Silenced a bunch of clang warnings --- Graphics/GLSLTools/CMakeLists.txt | 10 +++++++++- Graphics/GraphicsEngineOpenGL/CMakeLists.txt | 20 ++++++++++++++++++++ Graphics/GraphicsEngineVulkan/CMakeLists.txt | 7 +++++++ 3 files changed, 36 insertions(+), 1 deletion(-) (limited to 'Graphics') diff --git a/Graphics/GLSLTools/CMakeLists.txt b/Graphics/GLSLTools/CMakeLists.txt index 239342e6..2962c669 100644 --- a/Graphics/GLSLTools/CMakeLists.txt +++ b/Graphics/GLSLTools/CMakeLists.txt @@ -25,6 +25,14 @@ if(VULKAN_SUPPORTED) list(APPEND INCLUDE include/SPIRVUtils.hpp ) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # Disable the following warning: + # moving a local object in a return statement prevents copy elision [-Wpessimizing-move] + set_source_files_properties(src/SPIRVUtils.cpp + PROPERTIES + COMPILE_FLAGS -Wno-pessimizing-move + ) + endif() endif() endif() @@ -80,4 +88,4 @@ set_target_properties(Diligent-GLSLTools PROPERTIES if(DILIGENT_INSTALL_CORE) install_core_lib(Diligent-GLSLTools) -endif() \ No newline at end of file +endif() diff --git a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt index 0039de56..bbaf59c5 100644 --- a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt +++ b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt @@ -192,6 +192,26 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # as hiding is intended target_compile_options(Diligent-GraphicsEngineOpenGL-static PRIVATE -Wno-overloaded-virtual) target_compile_options(Diligent-GraphicsEngineOpenGL-shared PRIVATE -Wno-overloaded-virtual) + + # Disable warings like this one: + # comparison of function 'glPolygonMode' not equal to a null pointer is always true [-Wtautological-pointer-compare] + set_source_files_properties(src/RenderDeviceGLImpl.cpp src/GLContextState.cpp + PROPERTIES + COMPILE_FLAGS -Wno-tautological-pointer-compare + ) + + if (PLATFORM_IOS) + # Disable warings like this one: + # unused variable 'BottomLeftY' [-Wunused-variable] + set_source_files_properties( + src/DeviceContextGLImpl.cpp + src/GLContextState.cpp + src/RenderDeviceGLImpl.cpp + src/Texture1D_OGL.cpp + PROPERTIES + COMPILE_FLAGS -Wno-unused-variable + ) + endif() elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU") set_target_properties(Diligent-GraphicsEngineOpenGL-shared PROPERTIES # Disallow missing direct and indirect dependencies to enssure that .so is self-contained diff --git a/Graphics/GraphicsEngineVulkan/CMakeLists.txt b/Graphics/GraphicsEngineVulkan/CMakeLists.txt index 9300a081..baf08498 100644 --- a/Graphics/GraphicsEngineVulkan/CMakeLists.txt +++ b/Graphics/GraphicsEngineVulkan/CMakeLists.txt @@ -217,6 +217,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # as hiding is intended target_compile_options(Diligent-GraphicsEngineVk-static PRIVATE -Wno-overloaded-virtual) target_compile_options(Diligent-GraphicsEngineVk-shared PRIVATE -Wno-overloaded-virtual) + + # Disable the following warning: + # moving a local object in a return statement prevents copy elision [-Wpessimizing-move] + set_source_files_properties(src/CommandPoolManager.cpp src/VulkanUtilities/VulkanDebug.cpp + PROPERTIES + COMPILE_FLAGS -Wno-pessimizing-move + ) elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU") set_target_properties(Diligent-GraphicsEngineVk-shared PROPERTIES # Disallow missing direct and indirect dependencies to enssure that .so is self-contained -- cgit v1.2.3