CMAKE_LINK_WARNING_AS_ERROR

Added in version 4.0.

Specify whether to treat warnings on link as errors.

This variable is used to initialize the LINK_WARNING_AS_ERROR property on all the targets.