summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-21 18:29:27 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-21 19:04:33 (GMT)
commit4f5bbbeab9bbe7dd3aa3bd9be5d201ed2447bad1 (patch)
tree5b9afb2c7559f9a69137cbdcace548e9540c16bb /Source/cmMakefile.cxx
parent294cf948dc37799e1980685afbf1fa585ad5b0fb (diff)
downloadCMake-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.cxx7
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;
}