From 1ac2479b28c1114b0876123e0db4155abfbf06fe Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 29 Dec 2020 18:06:25 +0100 Subject: [PATCH] made warning flag optional --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02849ca44..aaf9a8af9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,11 +110,18 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(WARNING_FLAGS -Wall -Wextra - -Wshadow=local -Wimplicit-fallthrough=1 -Wno-unused-parameter -Wno-psabi ) + + if(NOT DEFINED WARNING_SHADOW_LOCAL) + option(WARNING_SHADOW_LOCAL "Show shadows declarations warning." ON) + endif() + + if(WARNING_SHADOW_LOCAL) + list(APPEND WARNING_FLAGS "-Wshadow=local") + endif() endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")