mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
CMP0005: Remove support for OLD behavior
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
CMP0005
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Preprocessor definition values are now escaped automatically.
|
||||
|
||||
This policy determines whether or not CMake should generate escaped
|
||||
@@ -20,7 +23,5 @@ See documentation of the ``COMPILE_DEFINITIONS`` target property for
|
||||
limitations of the escaping implementation.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
||||
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
|
||||
.. include:: STANDARD_ADVICE.txt
|
||||
|
||||
.. include:: DEPRECATED.txt
|
||||
.. |WARNED_OR_DID_NOT_WARN| replace:: warned
|
||||
.. include:: REMOVED_EPILOGUE.txt
|
||||
|
||||
@@ -1523,27 +1523,6 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Definitions with non-trivial values require a policy check.
|
||||
static cmsys::RegularExpression trivial(
|
||||
"^[-/]D[A-Za-z_][A-Za-z0-9_]*(=[A-Za-z0-9_.]+)?$");
|
||||
if (!trivial.find(def)) {
|
||||
// This definition has a non-trivial value.
|
||||
switch (this->GetPolicyStatus(cmPolicies::CMP0005)) {
|
||||
case cmPolicies::WARN:
|
||||
this->IssueMessage(MessageType::AUTHOR_WARNING,
|
||||
cmPolicies::GetPolicyWarning(cmPolicies::CMP0005));
|
||||
CM_FALLTHROUGH;
|
||||
case cmPolicies::OLD:
|
||||
// OLD behavior is to not escape the value. We should not
|
||||
// convert the definition to use the property.
|
||||
return false;
|
||||
case cmPolicies::NEW:
|
||||
// NEW behavior is to escape the value. Proceed to convert it
|
||||
// to an entry in the property.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the definition part after the flag.
|
||||
const char* define = def.c_str() + 2;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class cmMakefile;
|
||||
6, 0, NEW) \
|
||||
SELECT(POLICY, CMP0005, \
|
||||
"Preprocessor definition values are now escaped automatically.", 2, \
|
||||
6, 0, WARN) \
|
||||
6, 0, NEW) \
|
||||
SELECT(POLICY, CMP0006, \
|
||||
"Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.", \
|
||||
2, 6, 0, WARN) \
|
||||
|
||||
Reference in New Issue
Block a user