in gcc `-Wno-unsupported-something` will not be an error or even a warning,
so cmake will think the flag is supported. But if there's any other
warning during compilation, for any reason, unknown option will
be a warning too. Or an error when -Werror, even if that "other warning"
would not be an error on itself.
So we need to detect whether `-Wno-unsupported-something` is *really*
supported. Luckily, `-Wunsupported-something` will always fail with an
error.
So, whenever there's a need to detect if -Wno-something is supported,
test -Wsomething instead.
(that is MY_CHECK_C_COMPILER_FLAG, MY_CHECK_CXX_COMPILER_FLAG,
MY_CHECK_AND_SET_COMPILER_FLAG)
This is to have a clear "internal" name prefix and to avoid
mixing them with hand-named symbols
Fix all cmake tests (including plugin) to use
MY_CHECK_AND_SET_COMPILER_FLAG. And fix that function
to be compatible with cmake 3.0. This way flag checks
are correctly cached (even in cmake 3.0) and properly reused.
If a flag is supported only for C or C++ - add it to the
corresponding compiler option list. Old behavior was to
add always to both, but only if supported in both.