check_c_compiler_flag does not seem to check for "invalid feature modifier"
I'm currently on a project that has to compile against a large number of targets. One of the components I'm compiling is AOM, which uses check_c_compiler_flag
to determine legitimate compiler options for various optimizations (see cpu.cmake). Unfortunately, this error detection appears to fail under CMake.
GCC will emit an error like this:
➜ tmp g++ -march=armv8.2-a+bad limits.cpp
cc1plus: error: invalid feature modifier in ‘-march=armv8.2-a+dotprod+i8mm+sve’
Clang will emit an error like this:
➜ tmp clang -march=armv8.2-a+bad limits.cpp
clang-16: error: unsupported argument 'armv8.2-a+bad' to option '-march='
Neither flag is currently recognized by CMakeCheckCompilerFlagCommonPatterns.cmake
. I locally added unsupported argument
and that appeared to work, but it did not detect invalid feature modifier
. Is it possible that the delegation to cc1plus
causes CMake to miss it, even when added?