This PR addresses scenarios where the build environment, such as OSS-Fuzz, provides the -Wno-error=unknown-warning-option flag, which undermines our use of -Werror when checking compiler flags.
To reproduce the issue on the master branch @ c1f0a89d9caeb62a0a5f3462b454746941e626e6:
0$ env CXX=clang++ CC=clang CXXFLAGS="-Wno-error=unknown-warning-option" cmake -B build 2>&1 | grep WDUPLICATED_BRANCHES
1-- Performing Test CXX_SUPPORTS__WDUPLICATED_BRANCHES
2-- Performing Test CXX_SUPPORTS__WDUPLICATED_BRANCHES - Success
This output shows that the -Wduplicated-branches flag is incorrectly treated as recognised by the compiler.
Noticed while working on the migration to Ubuntu 24.04 in OSS-Fuzz.