diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-09-15 21:54:01 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2012-09-19 13:30:57 (GMT) |
commit | 4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46 (patch) | |
tree | 57a48f6e311086bd39520389d700bbb70d4b39d6 /Source/cmGeneratorTarget.cxx | |
parent | 987e12e2f962b6e9ed9f15f8ff486512911b744e (diff) | |
download | CMake-4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46.zip CMake-4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46.tar.gz CMake-4f5384e75c6a00d110d3fa3f555a3f6a4f31bb46.tar.bz2 |
Move GetLinkInformation to cmGeneratorTarget
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index d77e47b..e53f35e 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -14,9 +14,12 @@ #include "cmTarget.h" #include "cmMakefile.h" #include "cmLocalGenerator.h" +#include "cmComputeLinkInformation.h" #include "cmGlobalGenerator.h" #include "cmSourceFile.h" +#include <assert.h> + //---------------------------------------------------------------------------- cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t) { @@ -27,6 +30,15 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t) this->LookupObjectLibraries(); } +cmGeneratorTarget::~cmGeneratorTarget() +{ + for(std::map<cmStdString, cmComputeLinkInformation*>::iterator i + = LinkInformation.begin(); i != LinkInformation.end(); ++i) + { + delete i->second; + } +} + //---------------------------------------------------------------------------- int cmGeneratorTarget::GetType() const { @@ -277,3 +289,29 @@ void cmGeneratorTarget::GenerateTargetManifest(const char* config) gg->AddToManifest(config? config:"", f); } } + +//---------------------------------------------------------------------------- +cmComputeLinkInformation* +cmGeneratorTarget::GetLinkInformation(const char* config) +{ + // Lookup any existing information for this configuration. + std::map<cmStdString, cmComputeLinkInformation*>::iterator + i = this->LinkInformation.find(config?config:""); + if(i == this->LinkInformation.end()) + { + // Compute information for this configuration. + cmComputeLinkInformation* info = + new cmComputeLinkInformation(this->Target, config); + if(!info || !info->Compute()) + { + delete info; + info = 0; + } + + // Store the information for this configuration. + std::map<cmStdString, cmComputeLinkInformation*>::value_type + entry(config?config:"", info); + i = this->LinkInformation.insert(entry).first; + } + return i->second; +} |