diff options
author | Brad King <brad.king@kitware.com> | 2023-10-03 16:09:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-10-03 21:21:47 (GMT) |
commit | 86d910ab73c83a949220ca7f0388f7aa5a32aa3c (patch) | |
tree | cfcafdc47bcef4a49bfffbb82d2a12e194796489 /Source | |
parent | 4459d25c4adb117ceda5ab368d40fbc55172895d (diff) | |
download | CMake-86d910ab73c83a949220ca7f0388f7aa5a32aa3c.zip CMake-86d910ab73c83a949220ca7f0388f7aa5a32aa3c.tar.gz CMake-86d910ab73c83a949220ca7f0388f7aa5a32aa3c.tar.bz2 |
Add deprecation warnings for policies CMP0126 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.21 and below to encourage projects to port
away from setting policies to OLD.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefile.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 80f8a77..40d769d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4630,12 +4630,13 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, } // Deprecate old policies. - if (status == cmPolicies::OLD && id <= cmPolicies::CMP0120 && + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0126 && !(this->GetCMakeInstance()->GetIsInTryCompile() && ( // Policies set by cmCoreTryCompile::TryCompileCode. id == cmPolicies::CMP0065 || id == cmPolicies::CMP0083 || - id == cmPolicies::CMP0091 || id == cmPolicies::CMP0104)) && + id == cmPolicies::CMP0091 || id == cmPolicies::CMP0104 || + id == cmPolicies::CMP0123 || id == cmPolicies::CMP0126)) && (!this->IsSet("CMAKE_WARN_DEPRECATED") || this->IsOn("CMAKE_WARN_DEPRECATED"))) { this->IssueMessage(MessageType::DEPRECATION_WARNING, |