cmake: Disable -Wsuggest-override option in case of using PCH #11433

This commit is contained in:
Sayed Adel 2018-05-02 08:19:50 +00:00
parent 684cf43360
commit 788d6a7105

View File

@ -104,7 +104,7 @@ if(CV_GCC OR CV_CLANG)
add_extra_compiler_option(-Wuninitialized) add_extra_compiler_option(-Wuninitialized)
add_extra_compiler_option(-Winit-self) add_extra_compiler_option(-Winit-self)
if(HAVE_CXX11) if(HAVE_CXX11)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT ENABLE_PRECOMPILED_HEADERS)
add_extra_compiler_option(-Wsuggest-override) add_extra_compiler_option(-Wsuggest-override)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_extra_compiler_option(-Winconsistent-missing-override) add_extra_compiler_option(-Winconsistent-missing-override)