From 888c8af6cbfcbaffeca2fb65a0da864141ffff7b Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 13 Apr 2017 10:08:36 -0400 Subject: VS: List config-specific object library files on link lines In cases that we need to list object library files on link lines, look up the set of files matching the configuration of each link line. --- Source/cmLocalVisualStudio7Generator.cxx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 56ce2bd..1a33a28 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -30,7 +30,7 @@ public: typedef cmComputeLinkInformation::ItemVector ItemVector; void OutputLibraries(std::ostream& fout, ItemVector const& libs); void OutputObjects(std::ostream& fout, cmGeneratorTarget* t, - const char* isep = 0); + std::string const& config, const char* isep = 0); private: cmLocalVisualStudio7Generator* LocalGenerator; @@ -1043,7 +1043,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 || this->FortranProject) { std::ostringstream libdeps; - this->Internal->OutputObjects(libdeps, target); + this->Internal->OutputObjects(libdeps, target, configName); if (!libdeps.str().empty()) { fout << "\t\t\t\tAdditionalDependencies=\"" << libdeps.str() << "\"\n"; @@ -1096,7 +1096,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()); if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 || this->FortranProject) { - this->Internal->OutputObjects(fout, target, " "); + this->Internal->OutputObjects(fout, target, configName, " "); } fout << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); @@ -1181,7 +1181,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( << this->Makefile->GetSafeDefinition(standardLibsVar.c_str()); if (this->GetVersion() < cmGlobalVisualStudioGenerator::VS8 || this->FortranProject) { - this->Internal->OutputObjects(fout, target, " "); + this->Internal->OutputObjects(fout, target, configName, " "); } fout << " "; this->Internal->OutputLibraries(fout, cli.GetItems()); @@ -1300,21 +1300,20 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries( } void cmLocalVisualStudio7GeneratorInternals::OutputObjects( - std::ostream& fout, cmGeneratorTarget* gt, const char* isep) + std::ostream& fout, cmGeneratorTarget* gt, std::string const& configName, + const char* isep) { // 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 sources; - if (!gt->GetConfigCommonSourceFiles(sources)) { - return; - } + std::vector objs; + gt->GetExternalObjects(objs, configName); const char* sep = isep ? isep : ""; - for (std::vector::const_iterator i = sources.begin(); - i != sources.end(); i++) { + for (std::vector::const_iterator i = objs.begin(); + i != objs.end(); ++i) { if (!(*i)->GetObjectLibrary().empty()) { std::string const& objFile = (*i)->GetFullPath(); std::string rel = lg->ConvertToRelativePath(currentBinDir, objFile); -- cgit v0.12