diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-09-06 21:52:42 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-09-19 19:36:12 (GMT) |
commit | 839c65bca032b80cfa7fe0de2ad35c2448421092 (patch) | |
tree | 89128503dafc452ce33455f6dbce08927b48be3d /Source/cmLocalVisualStudio7Generator.cxx | |
parent | 21b5fdf9a39f739c3566f3e77a4c5244da1b7e3a (diff) | |
download | CMake-839c65bca032b80cfa7fe0de2ad35c2448421092.zip CMake-839c65bca032b80cfa7fe0de2ad35c2448421092.tar.gz CMake-839c65bca032b80cfa7fe0de2ad35c2448421092.tar.bz2 |
Convert: Move access to CurrentBinaryDirectory out of loops
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 459203a..f477a0e 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1298,10 +1298,11 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries( std::ostream& fout, ItemVector const& libs) { cmLocalVisualStudio7Generator* lg = this->LocalGenerator; + std::string currentBinDir = lg->GetCurrentBinaryDirectory(); for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) { if (l->IsPath) { - std::string rel = lg->ConvertToRelativePath( - lg->GetCurrentBinaryDirectory(), l->Value.c_str()); + std::string rel = + lg->ConvertToRelativePath(currentBinDir, l->Value.c_str()); fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " "; } else if (!l->Target || l->Target->GetType() != cmState::INTERFACE_LIBRARY) { @@ -1316,13 +1317,13 @@ void cmLocalVisualStudio7GeneratorInternals::OutputObjects( // VS < 8 does not support per-config source locations so we // list object library content on the link line instead. cmLocalVisualStudio7Generator* lg = this->LocalGenerator; + std::string currentBinDir = lg->GetCurrentBinaryDirectory(); std::vector<std::string> objs; gt->UseObjectLibraries(objs, ""); const char* sep = isep ? isep : ""; for (std::vector<std::string>::const_iterator oi = objs.begin(); oi != objs.end(); ++oi) { - std::string rel = - lg->ConvertToRelativePath(lg->GetCurrentBinaryDirectory(), oi->c_str()); + std::string rel = lg->ConvertToRelativePath(currentBinDir, oi->c_str()); fout << sep << lg->ConvertToXMLOutputPath(rel.c_str()); sep = " "; } @@ -1332,6 +1333,7 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories( std::ostream& fout, std::vector<std::string> const& dirs) { const char* comma = ""; + std::string currentBinDir = this->GetCurrentBinaryDirectory(); for (std::vector<std::string>::const_iterator d = dirs.begin(); d != dirs.end(); ++d) { // Remove any trailing slash and skip empty paths. @@ -1345,8 +1347,8 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories( // Switch to a relative path specification if it is shorter. if (cmSystemTools::FileIsFullPath(dir.c_str())) { - std::string rel = this->ConvertToRelativePath( - this->GetCurrentBinaryDirectory(), dir.c_str()); + std::string rel = + this->ConvertToRelativePath(currentBinDir, dir.c_str()); if (rel.size() < dir.size()) { dir = rel; } |