Files
Matthew Woehlke 72e7305c3e Diagnostics: Handle CMAKE_{WARN,ERROR}_DEPRECATED
Update documentation for aforementioned variables, as their use is
deprecated under the new diagnostic system. Introduce a policy which
reintroduces their use to control specific deprecation diagnostics if
the policy is not NEW.

Note that this means there is NO synchronization between the variables
and the new diagnostic state.
2026-05-07 11:07:27 -04:00

16 lines
555 B
CMake

cmake_diagnostic(SET CMD_DEPRECATED IGNORE)
# Note: We're using the deprecation warning from cmMakefile::SetPolicy as a
# test, which requires use of policies within the deprecation window (as of
# CMake 4.4, CMP0066...CMP0155). These will likely need to be rotated to newer
# policies when that window changes.
cmake_policy(SET CMP0218 NEW)
cmake_policy(SET CMP0152 OLD) # should be silent
cmake_policy(SET CMP0218 OLD)
cmake_policy(SET CMP0153 OLD) # should NOT be silent
set(CMAKE_ERROR_DEPRECATED ON)
message(DEPRECATION "Test") # should be error