diff options
author | Brad King <brad.king@kitware.com> | 2010-08-24 22:47:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-08-24 22:47:56 (GMT) |
commit | 79a88c35f886258a43ee6169d2d7b4f2e1eb0b95 (patch) | |
tree | c44185016a16e3fc10cc4c9dc8e6e874548adfcc /Source/cmGlobalVisualStudio71Generator.cxx | |
parent | 325bdb2a92bbbbe18ae2cbffc000bd6e0dd0367a (diff) | |
download | CMake-79a88c35f886258a43ee6169d2d7b4f2e1eb0b95.zip CMake-79a88c35f886258a43ee6169d2d7b4f2e1eb0b95.tar.gz CMake-79a88c35f886258a43ee6169d2d7b4f2e1eb0b95.tar.bz2 |
Refactor VS <= 7.1 utility-depends workaround
Commit 438a7e2f (Fix utility dependencies for static libraries in VS
generators, 2007-04-04) implemented utility-only dependencies between
linkable targets by introducing an intermediate non-linkable target.
We convert a dependency of the form
foo -> bar
to the form
foo -> bar_UTILITY -> bar
to prevent foo from including bar on its link line. Previously we added
the extra "_UTILITY" targets explicitly among the project targets before
dependency analysis was performed. Now we generate them separately at
the last moment so that cmGlobalGenerator need not be aware of them.
Diffstat (limited to 'Source/cmGlobalVisualStudio71Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index ac1bfa5..4f5901c 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -163,16 +163,31 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, ext = targetExt; } + std::string guid = this->GetGUID(dspname); fout << project << dspname << "\", \"" << this->ConvertToSolutionPath(dir) - << "\\" << dspname << ext << "\", \"{" - << this->GetGUID(dspname) << "}\"\n"; + << "\\" << dspname << ext << "\", \"{" << guid << "}\"\n"; fout << "\tProjectSection(ProjectDependencies) = postProject\n"; this->WriteProjectDepends(fout, dspname, dir, t); fout << "\tEndProjectSection\n"; fout <<"EndProject\n"; + + UtilityDependsMap::iterator ui = this->UtilityDepends.find(&t); + if(ui != this->UtilityDepends.end()) + { + const char* uname = ui->second.c_str(); + fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" + << uname << "\", \"" + << this->ConvertToSolutionPath(dir) + << "\\" << uname << ".vcproj" << "\", \"{" + << this->GetGUID(uname) << "}\"\n" + << "\tProjectSection(ProjectDependencies) = postProject\n" + << "\t\t{" << guid << "} = {" << guid << "}\n" + << "\tEndProjectSection\n" + << "EndProject\n"; + } } //---------------------------------------------------------------------------- |