diff options
author | Brad King <brad.king@kitware.com> | 2014-06-19 17:38:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-07 12:52:41 (GMT) |
commit | 61ef8daad5d15256daec08eeb0437fdece330001 (patch) | |
tree | 4f376fbd2ed9658c13687ce5e1b543c7b113050c /Source | |
parent | d9586f83f11f56d8d9f88892f543918f50e9525c (diff) | |
download | CMake-61ef8daad5d15256daec08eeb0437fdece330001.zip CMake-61ef8daad5d15256daec08eeb0437fdece330001.tar.gz CMake-61ef8daad5d15256daec08eeb0437fdece330001.tar.bz2 |
cmTarget: Simplify INTERFACE_COMPILE_DEFINITIONS usage requirement lookup
Use the AddInterfaceEntries helper to avoid duplication.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmTarget.cxx | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 2cc21f5..e35167e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2504,45 +2504,9 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list, if (!this->Internal->CacheLinkInterfaceCompileDefinitionsDone[config]) { - for (std::vector<cmValueWithOrigin>::const_iterator - it = this->Internal->LinkImplementationPropertyEntries.begin(), - end = this->Internal->LinkImplementationPropertyEntries.end(); - it != end; ++it) - { - if (!cmGeneratorExpression::IsValidTargetName(it->Value) - && cmGeneratorExpression::Find(it->Value) == std::string::npos) - { - continue; - } - { - cmGeneratorExpression ge; - cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = - ge.Parse(it->Value); - std::string targetResult = cge->Evaluate(this->Makefile, config, - false, this, 0, 0); - if (!this->Makefile->FindTargetToUse(targetResult)) - { - continue; - } - } - std::string defsGenex = "$<TARGET_PROPERTY:" + - it->Value + ",INTERFACE_COMPILE_DEFINITIONS>"; - if (cmGeneratorExpression::Find(it->Value) != std::string::npos) - { - // Because it->Value is a generator expression, ensure that it - // evaluates to the non-empty string before being used in the - // TARGET_PROPERTY expression. - defsGenex = "$<$<BOOL:" + it->Value + ">:" + defsGenex + ">"; - } - cmGeneratorExpression ge(&it->Backtrace); - cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse( - defsGenex); - - this->Internal - ->CachedLinkInterfaceCompileDefinitionsEntries[config].push_back( - new cmTargetInternals::TargetPropertyEntry(cge, - it->Value)); - } + this->Internal->AddInterfaceEntries( + this, config, "INTERFACE_COMPILE_DEFINITIONS", + this->Internal->CachedLinkInterfaceCompileDefinitionsEntries[config]); if (!config.empty()) { std::string configPropName = "COMPILE_DEFINITIONS_" |