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/cmGlobalVisualStudio71Generator.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/cmGlobalVisualStudio71Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 62 |
1 files changed, 12 insertions, 50 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 1191575..ac1bfa5 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -185,59 +185,21 @@ cmGlobalVisualStudio71Generator const char* dspname, const char*, cmTarget& target) { -#if 0 - // Create inter-target dependencies in the solution file. For VS - // 7.1 and below we cannot let static libraries depend directly on - // targets to which they "link" because the librarian tool will copy - // the targets into the static library. See - // cmGlobalVisualStudioGenerator::FixUtilityDependsForTarget for a - // work-around. VS 8 and above do not have this problem. - if (!this->VSLinksDependencies() || - target.GetType() != cmTarget::STATIC_LIBRARY); -#else - if (target.GetType() != cmTarget::STATIC_LIBRARY) -#endif + VSDependSet const& depends = this->VSTargetDepends[&target]; + for(VSDependSet::const_iterator di = depends.begin(); + di != depends.end(); ++di) { - cmTarget::LinkLibraryVectorType::const_iterator j, jend; - j = target.GetLinkLibraries().begin(); - jend = target.GetLinkLibraries().end(); - for(;j!= jend; ++j) + const char* name = di->c_str(); + std::string guid = this->GetGUID(name); + if(guid.size() == 0) { - if(j->first != dspname) - { - // is the library part of this SLN ? If so add dependency - // find target anywhere because all depend libraries are - // brought in as well - if(this->FindTarget(0, j->first.c_str())) - { - fout << "\t\t{" << this->GetGUID(j->first.c_str()) << "} = {" - << this->GetGUID(j->first.c_str()) << "}\n"; - } - } - } - } - - 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 name = this->GetUtilityForTarget(target, i->c_str()); - std::string guid = this->GetGUID(name.c_str()); - if(guid.size() == 0) - { - std::string m = "Target: "; - m += target.GetName(); - m += " depends on unknown target: "; - m += name; - cmSystemTools::Error(m.c_str()); - } - - fout << "\t\t{" << guid << "} = {" << guid << "}\n"; + std::string m = "Target: "; + m += target.GetName(); + m += " depends on unknown target: "; + m += name; + cmSystemTools::Error(m.c_str()); } + fout << "\t\t{" << guid << "} = {" << guid << "}\n"; } } |