From 7324903172c69382cb3e065b6634af35d938fd3b Mon Sep 17 00:00:00 2001 From: Zhanlue Yang Date: Sat, 7 May 2022 12:43:02 +0800 Subject: [PATCH] [build] Warning Suppression PR #3: Eliminate warnings from third-party headers (#4920) * [build] Warning Suppression PR #1: Turned on -Wno-ignored-attributes & Removed unused functions * [build] Warning Suppression PR #2: Eliminate warnings from third-party headers * Fixed an warning with enum comparison --- cmake/TaichiCore.cmake | 4 +++- taichi/backends/vulkan/vulkan_device.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/TaichiCore.cmake b/cmake/TaichiCore.cmake index 3096832be40c7..1a41bc2020552 100644 --- a/cmake/TaichiCore.cmake +++ b/cmake/TaichiCore.cmake @@ -379,7 +379,9 @@ if (TI_WITH_VULKAN) target_include_directories(${CORE_LIBRARY_NAME} PRIVATE external/SPIRV-Headers/include) target_include_directories(${CORE_LIBRARY_NAME} PRIVATE external/SPIRV-Reflect) - target_include_directories(${CORE_LIBRARY_NAME} PRIVATE external/VulkanMemoryAllocator/include) + + # By specifying SYSTEM, we suppressed the warnings from third-party headers. + target_include_directories(${CORE_LIBRARY_NAME} SYSTEM PRIVATE external/VulkanMemoryAllocator/include) if (LINUX) # shaderc requires pthread diff --git a/taichi/backends/vulkan/vulkan_device.cpp b/taichi/backends/vulkan/vulkan_device.cpp index 62b1b4fe6b865..a739758e69f88 100644 --- a/taichi/backends/vulkan/vulkan_device.cpp +++ b/taichi/backends/vulkan/vulkan_device.cpp @@ -278,7 +278,7 @@ void VulkanPipeline::create_descriptor_set_layout(const Params ¶ms) { for (auto var : variables) { // We want to remove auxiliary outputs such as frag depth - if (var->built_in == -1) { + if (static_cast(var->built_in) == -1) { render_target_count++; } }