Add -Wshadow if supported

This commit is contained in:
Matt Clarkson 2014-08-01 10:53:24 +01:00
parent e863292dcc
commit 6945096ba1
1 changed files with 4 additions and 0 deletions

View File

@ -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")