From f4251525dece37071d846901107deef3978c55ad Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Tue, 27 Sep 2022 18:11:18 +0000 Subject: [PATCH] Adding Wunused-lambda-capture to Clang build flags (#85655) Add `-Wunused-lambda-capture` to clang build flags to better align internal and OSS build systems. This flag is not supported in gcc so only adding for clang builds. Pull Request resolved: https://github.com/pytorch/pytorch/pull/85655 Approved by: https://github.com/huydhn --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d88eb14efeb..e8ab95f4e5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -893,6 +893,7 @@ if(NOT MSVC) append_cxx_flag_if_supported("-Wno-c++14-extensions" CMAKE_CXX_FLAGS) append_cxx_flag_if_supported("-Wno-constexpr-not-const" CMAKE_CXX_FLAGS) append_cxx_flag_if_supported("-Wno-missing-braces" CMAKE_CXX_FLAGS) + append_cxx_flag_if_supported("-Wunused-lambda-capture" CMAKE_CXX_FLAGS) append_cxx_flag_if_supported("-Qunused-arguments" CMAKE_CXX_FLAGS) if(${USE_COLORIZE_OUTPUT}) endif()