Skip to content

Add Target Property to treat Warnings as Errors

Martin Duffy requested to merge werror-property into master

Adds Target Property COMPILE_WARNING_AS_ERROR and Variable CMAKE_COMPILE_WARNING_AS_ERROR.

COMPILE_WARNING_AS_ERROR is initialized by CMAKE_COMPILE_WARNING_AS_ERROR. It is a boolean variable. If it is true, it expands to a different flag depending on the compiler such that any warnings at compile will be treated as errors.

Supports the following compiler ids that I could find a relevant flag for: GNU, Clang, AppleClang, MSVC, SunPro, Intel, Fujitsu, NVCC.

Merge request reports