Skip to content

CheckCompilerFlag: Not detecting MSVC -Werror or -Wextra as invalid flags

It's possible that cmake is not detecting some invalid flags for VC2022 (maybe a new pattern that must be introduced in CHECK_COMPILER_FLAG_COMMON_PATTERNS?), for example -Werror or -Wextra. I've created a little project where it looks like check_cxx_compiler_flag() doesn't fail for these flags and then the compiler fails with the following error:

cl : Command line error D8021 : invalid numeric argument '/Wextra'
Edited by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information