From 6945096ba16bfae115309e4318b077c9d9fc2f28 Mon Sep 17 00:00:00 2001 From: Matt Clarkson Date: Fri, 1 Aug 2014 10:53:24 +0100 Subject: [PATCH] Add -Wshadow if supported --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 721222a5..c1ad616f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,10 @@ check_cxx_compiler_flag(-Wall HAVE_FLAG_WALL) if (HAVE_FLAG_WALL) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") endif() +check_cxx_compiler_flag(-Wshadow HAVE_FLAG_WSHADOW) +if (HAVE_FLAG_WSHADOW) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow") +endif() check_cxx_compiler_flag(-Werror HAVE_FLAG_WERROR) if (HAVE_FLAG_WERROR) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")