mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 12:49:50 -05:00
Do not treat DEFINITIONS as a built-in directory property
Add policy CMP0059 to cover this change. The property has been deprecated since CMake 2.4 anyway. This will help clean up cmMakefile -- the DefineFlagsOrig member should not need to exist.
This commit is contained in:
+13
-2
@@ -4209,8 +4209,19 @@ const char *cmMakefile::GetProperty(const std::string& prop,
|
||||
}
|
||||
else if (prop == "DEFINITIONS")
|
||||
{
|
||||
output += this->DefineFlagsOrig;
|
||||
return output.c_str();
|
||||
switch(this->GetPolicyStatus(cmPolicies::CMP0059))
|
||||
{
|
||||
case cmPolicies::WARN:
|
||||
this->IssueMessage(cmake::AUTHOR_WARNING, this->GetPolicies()->
|
||||
GetPolicyWarning(cmPolicies::CMP0059));
|
||||
case cmPolicies::OLD:
|
||||
output += this->DefineFlagsOrig;
|
||||
return output.c_str();
|
||||
case cmPolicies::NEW:
|
||||
case cmPolicies::REQUIRED_ALWAYS:
|
||||
case cmPolicies::REQUIRED_IF_USED:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (prop == "LINK_DIRECTORIES")
|
||||
{
|
||||
|
||||
@@ -385,6 +385,11 @@ cmPolicies::cmPolicies()
|
||||
CMP0058, "CMP0058",
|
||||
"Ninja requires custom command byproducts to be explicit.",
|
||||
3,3,0, cmPolicies::WARN);
|
||||
|
||||
this->DefinePolicy(
|
||||
CMP0059, "CMP0059",
|
||||
"Do no treat DEFINITIONS as a built-in directory property.",
|
||||
3,3,0, cmPolicies::WARN);
|
||||
}
|
||||
|
||||
cmPolicies::~cmPolicies()
|
||||
|
||||
@@ -116,6 +116,8 @@ public:
|
||||
CMP0057, ///< Disallow multiple MAIN_DEPENDENCY specifications
|
||||
/// for the same file.
|
||||
CMP0058, ///< Ninja requires custom command byproducts to be explicit
|
||||
CMP0059, ///< Do not treat ``DEFINITIONS`` as a built-in directory
|
||||
/// property.
|
||||
|
||||
/** \brief Always the last entry.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user