diff options
author | Brad King <brad.king@kitware.com> | 2017-04-21 18:29:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-21 19:04:33 (GMT) |
commit | 4f5bbbeab9bbe7dd3aa3bd9be5d201ed2447bad1 (patch) | |
tree | 5b9afb2c7559f9a69137cbdcace548e9540c16bb /Source/cmMakefile.cxx | |
parent | 294cf948dc37799e1980685afbf1fa585ad5b0fb (diff) | |
download | CMake-4f5bbbeab9bbe7dd3aa3bd9be5d201ed2447bad1.zip CMake-4f5bbbeab9bbe7dd3aa3bd9be5d201ed2447bad1.tar.gz CMake-4f5bbbeab9bbe7dd3aa3bd9be5d201ed2447bad1.tar.bz2 |
Add deprecation warnings for policies CMP0036 and below
The OLD behaviors of all policies are deprecated, but only by
documentation. Add an explicit deprecation diagnostic for some policies
to encourage projects to port away from setting policies to OLD.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 4ed76c7..b8a5293 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4002,6 +4002,13 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, return false; } + // Deprecate old policies, especially those that require a lot + // of code to maintain the old behavior. + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0036) { + this->IssueMessage(cmake::DEPRECATION_WARNING, + cmPolicies::GetPolicyDeprecatedWarning(id)); + } + this->StateSnapshot.SetPolicy(id, status); return true; } |