diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-12-30 12:33:02 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-01-08 15:41:34 (GMT) |
commit | 5bb53f6b731228e4592066329e8992987289a986 (patch) | |
tree | 77176fe26f9f2d658094d5964d56a9abd52d551d /Source/cmTarget.cxx | |
parent | 855e8759fdf20a209f19f02e8dc5d203f4713a6a (diff) | |
download | CMake-5bb53f6b731228e4592066329e8992987289a986.zip CMake-5bb53f6b731228e4592066329e8992987289a986.tar.gz CMake-5bb53f6b731228e4592066329e8992987289a986.tar.bz2 |
cmTarget: Deprecate COMPILE_DEFINITIONS_ properties with a policy.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b06480b..a8468ef 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2209,14 +2209,34 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list, std::string configPropName = "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(config); const char *configProp = this->GetProperty(configPropName.c_str()); - std::string defsString = (configProp ? configProp : ""); - - cmGeneratorExpression ge(lfbt); - cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = - ge.Parse(defsString); - this->Internal - ->CachedLinkInterfaceCompileDefinitionsEntries[configString].push_back( - new cmTargetInternals::TargetPropertyEntry(cge)); + if (configProp) + { + switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0043)) + { + case cmPolicies::WARN: + { + cmOStringStream e; + e << this->Makefile->GetCMakeInstance()->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0043); + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, + e.str().c_str()); + } + case cmPolicies::OLD: + { + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(configProp); + this->Internal + ->CachedLinkInterfaceCompileDefinitionsEntries[configString] + .push_back(new cmTargetInternals::TargetPropertyEntry(cge)); + } + break; + case cmPolicies::NEW: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + break; + } + } } } |