mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-21 06:30:20 -06:00
Add deprecation warnings for policies CMP0128 and below
The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for policies introduced in CMake 3.22 and below to encourage projects to port away from setting policies to OLD.
This commit is contained in:
@@ -4657,13 +4657,14 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
|
||||
}
|
||||
|
||||
// Deprecate old policies.
|
||||
if (status == cmPolicies::OLD && id <= cmPolicies::CMP0126 &&
|
||||
if (status == cmPolicies::OLD && id <= cmPolicies::CMP0128 &&
|
||||
!(this->GetCMakeInstance()->GetIsInTryCompile() &&
|
||||
(
|
||||
// Policies set by cmCoreTryCompile::TryCompileCode.
|
||||
id == cmPolicies::CMP0065 || id == cmPolicies::CMP0083 ||
|
||||
id == cmPolicies::CMP0091 || id == cmPolicies::CMP0104 ||
|
||||
id == cmPolicies::CMP0123 || id == cmPolicies::CMP0126)) &&
|
||||
id == cmPolicies::CMP0123 || id == cmPolicies::CMP0126 ||
|
||||
id == cmPolicies::CMP0128)) &&
|
||||
(!this->IsSet("CMAKE_WARN_DEPRECATED") ||
|
||||
this->IsOn("CMAKE_WARN_DEPRECATED"))) {
|
||||
this->IssueMessage(MessageType::DEPRECATION_WARNING,
|
||||
|
||||
Reference in New Issue
Block a user