diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-05 15:37:51 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-08 21:41:29 (GMT) |
commit | a8429a402da4aeb717f4af234c8d14d1c4e10ed7 (patch) | |
tree | 1180acfc7d4c16f8ca35d447a63269447bf0c286 /Source/cmTarget.cxx | |
parent | 370bb92c10cd8fec7770267c93515623e4168012 (diff) | |
download | CMake-a8429a402da4aeb717f4af234c8d14d1c4e10ed7.zip CMake-a8429a402da4aeb717f4af234c8d14d1c4e10ed7.tar.gz CMake-a8429a402da4aeb717f4af234c8d14d1c4e10ed7.tar.bz2 |
cmTarget: Split storage of link implementation from backtraces.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index abfc40b..63c7740 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -114,7 +114,8 @@ public: std::vector<cmListFileBacktrace> CompileDefinitionsBacktraces; std::vector<std::string> SourceEntries; std::vector<cmListFileBacktrace> SourceBacktraces; - std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries; + std::vector<std::string> LinkImplementationPropertyEntries; + std::vector<cmListFileBacktrace> LinkImplementationPropertyBacktraces; }; //---------------------------------------------------------------------------- @@ -1380,11 +1381,12 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) else if (prop == "LINK_LIBRARIES") { this->Internal->LinkImplementationPropertyEntries.clear(); + this->Internal->LinkImplementationPropertyBacktraces.clear(); if (value) { cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmValueWithOrigin entry(value, lfbt); - this->Internal->LinkImplementationPropertyEntries.push_back(entry); + this->Internal->LinkImplementationPropertyEntries.push_back(value); + this->Internal->LinkImplementationPropertyBacktraces.push_back(lfbt); } } else if (prop == "SOURCES") @@ -1482,8 +1484,8 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, if (value && *value) { cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmValueWithOrigin entry(value, lfbt); - this->Internal->LinkImplementationPropertyEntries.push_back(entry); + this->Internal->LinkImplementationPropertyEntries.push_back(value); + this->Internal->LinkImplementationPropertyBacktraces.push_back(lfbt); } } else if (prop == "SOURCES") @@ -2048,17 +2050,7 @@ const char *cmTarget::GetProperty(const std::string& prop, } static std::string output; - output = ""; - std::string sep; - for (std::vector<cmValueWithOrigin>::const_iterator - it = this->Internal->LinkImplementationPropertyEntries.begin(), - end = this->Internal->LinkImplementationPropertyEntries.end(); - it != end; ++it) - { - output += sep; - output += it->Value; - sep = ";"; - } + output = cmJoin(this->Internal->LinkImplementationPropertyEntries, ";"); return output.c_str(); } // the type property returns what type the target is @@ -3223,19 +3215,21 @@ void cmTarget::ComputeLinkImplementationLibraries( cmOptionalLinkImplementation& impl, cmTarget const* head) const { + std::vector<cmListFileBacktrace>::const_iterator btIt = + this->Internal->LinkImplementationPropertyBacktraces.begin(); // Collect libraries directly linked in this configuration. - for (std::vector<cmValueWithOrigin>::const_iterator + for (std::vector<std::string>::const_iterator le = this->Internal->LinkImplementationPropertyEntries.begin(), end = this->Internal->LinkImplementationPropertyEntries.end(); - le != end; ++le) + le != end; ++le, ++btIt) { std::vector<std::string> llibs; cmGeneratorExpressionDAGChecker dagChecker( this->GetName(), "LINK_LIBRARIES", 0, 0); - cmGeneratorExpression ge(le->Backtrace); + cmGeneratorExpression ge(*btIt); cmsys::auto_ptr<cmCompiledGeneratorExpression> const cge = - ge.Parse(le->Value); + ge.Parse(*le); std::string const evaluated = cge->Evaluate(this->Makefile, config, false, head, &dagChecker); cmSystemTools::ExpandListArgument(evaluated, llibs); @@ -3290,7 +3284,7 @@ void cmTarget::ComputeLinkImplementationLibraries( // The entry is meant for this configuration. impl.Libraries.push_back( cmLinkImplItem(name, this->FindTargetToLink(name), - le->Backtrace, evaluated != le->Value)); + *btIt, evaluated != *le)); } std::set<std::string> const& seenProps = cge->GetSeenTargetProperties(); |