cmake: Disable -Wsuggest-override option in case of using PCH #11433
authorSayed Adel <seiko@imavr.com>
Wed, 2 May 2018 08:19:50 +0000 (08:19 +0000)
committerSayed Adel <seiko@imavr.com>
Wed, 2 May 2018 09:12:55 +0000 (09:12 +0000)
cmake/OpenCVCompilerOptions.cmake

index 774103af3abecd01cdbb1b6f1b685a6f9b2a4856..d83777fe4b0582f19f562f8b18176de3b0ab66e8 100644 (file)
@@ -104,7 +104,7 @@ if(CV_GCC OR CV_CLANG)
   add_extra_compiler_option(-Wuninitialized)
   add_extra_compiler_option(-Winit-self)
   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)
     elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
       add_extra_compiler_option(-Winconsistent-missing-override)