It seems to me that if CI checks the code with -Werror flag, it should also be included in cmake.
-Werror