diff options
author | Brad King <brad.king@kitware.com> | 2014-06-16 14:58:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-06-23 13:21:56 (GMT) |
commit | 097be4139df044c86daadb665ec224ee66e6b3bb (patch) | |
tree | 9d112d32470762de2953f7cd999a9401f60a4bcb /Source/cmTarget.cxx | |
parent | 4dad5fd20bfa330b3131fd5cafa709d85c1b58ec (diff) | |
download | CMake-097be4139df044c86daadb665ec224ee66e6b3bb.zip CMake-097be4139df044c86daadb665ec224ee66e6b3bb.tar.gz CMake-097be4139df044c86daadb665ec224ee66e6b3bb.tar.bz2 |
cmTarget: Add GetUtilityItems to get target ordering dependencies
Add a method like GetUtilities but that provides the target names
already looked up and resolved to cmTarget pointers internally. Update
call site in cmComputeTargetDepends::AddTargetDepend to use the
already-found target instead of looking it up again.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e4f26d1..6e4f65f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -95,11 +95,13 @@ public: : Backtrace(NULL) { this->PolicyWarnedCMP0022 = false; + this->UtilityItemsDone = false; } cmTargetInternals(cmTargetInternals const&) : Backtrace(NULL) { this->PolicyWarnedCMP0022 = false; + this->UtilityItemsDone = false; } ~cmTargetInternals(); @@ -151,6 +153,9 @@ public: SourceFilesMapType; SourceFilesMapType SourceFilesMap; + std::set<cmLinkItem> UtilityItems; + bool UtilityItemsDone; + struct TargetPropertyEntry { TargetPropertyEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge, const std::string &targetName = std::string()) @@ -471,6 +476,22 @@ cmListFileBacktrace const* cmTarget::GetUtilityBacktrace( } //---------------------------------------------------------------------------- +std::set<cmLinkItem> const& cmTarget::GetUtilityItems() const +{ + if(!this->Internal->UtilityItemsDone) + { + this->Internal->UtilityItemsDone = true; + for(std::set<std::string>::const_iterator i = this->Utilities.begin(); + i != this->Utilities.end(); ++i) + { + this->Internal->UtilityItems.insert( + cmLinkItem(*i, this->Makefile->FindTargetToUse(*i))); + } + } + return this->Internal->UtilityItems; +} + +//---------------------------------------------------------------------------- void cmTarget::FinishConfigure() { // Erase any cached link information that might have been comptued |