diff options
author | Brad King <brad.king@kitware.com> | 2010-08-24 22:39:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-08-24 22:39:36 (GMT) |
commit | 325bdb2a92bbbbe18ae2cbffc000bd6e0dd0367a (patch) | |
tree | 3c38d59caa8603dca3752306eb44dd7b42c2857a /Source/cmGlobalVisualStudio7Generator.cxx | |
parent | 6bea84353c76d392a9da11557ab888fa18ea1955 (diff) | |
download | CMake-325bdb2a92bbbbe18ae2cbffc000bd6e0dd0367a.zip CMake-325bdb2a92bbbbe18ae2cbffc000bd6e0dd0367a.tar.gz CMake-325bdb2a92bbbbe18ae2cbffc000bd6e0dd0367a.tar.bz2 |
Factor out duplicate VS target dependency code
Compute VS target dependencies in cmGlobalVisualStudioGenerator when the
main global dependency analysis is done. Use these results in each of
the VS generators instead of duplicating the analysis.
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 66 |
1 files changed, 15 insertions, 51 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 9631e9a..de88131 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -422,59 +422,23 @@ cmGlobalVisualStudio7Generator const char*, cmTarget& target) { int depcount = 0; - // insert Begin Project Dependency Project_Dep_Name project stuff here - if (target.GetType() != cmTarget::STATIC_LIBRARY) - { - cmTarget::LinkLibraryVectorType::const_iterator j, jend; - j = target.GetLinkLibraries().begin(); - jend = target.GetLinkLibraries().end(); - for(;j!= jend; ++j) - { - if(j->first != dspname) - { - // is the library part of this SLN ? If so add dependency - if(this->FindTarget(0, j->first.c_str())) - { - std::string guid = this->GetGUID(j->first.c_str()); - if(guid.size() == 0) - { - std::string m = "Target: "; - m += dspname; - m += " depends on unknown target: "; - m += j->first.c_str(); - cmSystemTools::Error(m.c_str()); - } - fout << "\t\t{" << this->GetGUID(dspname) << "}." - << depcount << " = {" << guid << "}\n"; - depcount++; - } - } - } - } - - std::set<cmStdString>::const_iterator i, end; - // write utility dependencies. - i = target.GetUtilities().begin(); - end = target.GetUtilities().end(); - for(;i!= end; ++i) - { - if(*i != dspname) + std::string dspguid = this->GetGUID(dspname); + VSDependSet const& depends = this->VSTargetDepends[&target]; + for(VSDependSet::const_iterator di = depends.begin(); + di != depends.end(); ++di) + { + const char* name = di->c_str(); + std::string guid = this->GetGUID(name); + if(guid.size() == 0) { - std::string name = this->GetUtilityForTarget(target, i->c_str()); - std::string guid = this->GetGUID(name.c_str()); - if(guid.size() == 0) - { - std::string m = "Target: "; - m += dspname; - m += " depends on unknown target: "; - m += name.c_str(); - cmSystemTools::Error(m.c_str()); - } - - fout << "\t\t{" << this->GetGUID(dspname) << "}." << depcount << " = {" - << guid << "}\n"; - depcount++; + std::string m = "Target: "; + m += target.GetName(); + m += " depends on unknown target: "; + m += name; + cmSystemTools::Error(m.c_str()); } + fout << "\t\t{" << dspguid << "}." << depcount << " = {" << guid << "}\n"; + depcount++; } } |