-Wno-inconsistent-missing-overide - from unknown source

I am attempting to compile package opencv-4.5.0 on an Armbian (Debian Buster) system.
I can compile this package no issues on another arm based system under Raspberry Pi OS.
I am using gcc 8.3.0-6 and cmake 3.13.4

The problem is during the cmake process when it generates a cc1plus check option warning about -Wno-inconsistent-missing-overide. cmake fails to complete and no Makefile is generated.

gcc does not support this option and there is no place in the source tree of opencv that supplies that option to GNU flags (It is used in clang variants only)

My guess the option is automatically generated by cmake in some place and it needs to be removed before the checking process. Either that or set some flag or parameter to stop it being generated and checked in the first place.

The opencv cmake framework is huge and I have no idea where to fix this problem. I have run cmake with trace enabled so I know where the flag is identified as an error, but I don’t know where or how it is generated, and how to deal with it.

Any assistance appreciated.

There is no match to that flag in the entire CMake source tree, but it is in modules/dnn/CMakeLists.txt in OpenCV.

True, but it’s only enabled for clang not GNU. And I commented that whole section out just to be sure.

My best guess is that cmake generates a ‘glob’ bunch of compiler flags that have to be whittled down for a particular compiler. That is why there is no explicit mention of the flag in the CMake source tree.

CMake doesn’t have much to do with warning flags. It has to be coming from OpenCV somewhere. Using cmake --trace-expand to find the string might help pinpoint it.