Skip to content

Commit

Permalink
cmake: enable override warnings (requires C++11 compilation mode)
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Mar 28, 2018
1 parent d800a0b commit 0ede1b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmake/OpenCVCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ if(CV_GCC OR CV_CLANG)
add_extra_compiler_option(-Wsign-promo)
add_extra_compiler_option(-Wuninitialized)
add_extra_compiler_option(-Winit-self)
if(HAVE_CXX11)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_extra_compiler_option(-Wsuggest-override)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_extra_compiler_option(-Winconsistent-missing-override)
endif()
endif()

if(ENABLE_NOISY_WARNINGS)
add_extra_compiler_option(-Wcast-align)
Expand Down

0 comments on commit 0ede1b5

Please sign in to comment.