summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-13 14:08:36 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-13 20:10:32 (GMT)
commit888c8af6cbfcbaffeca2fb65a0da864141ffff7b (patch)
treee73f7691436ff3a7e0efc523e8b34df8afe8a648 /Source/cmLocalVisualStudio7Generator.cxx
parent40aa6c059c3beebabf8fa433b768192300331e50 (diff)
downloadCMake-888c8af6cbfcbaffeca2fb65a0da864141ffff7b.zip
CMake-888c8af6cbfcbaffeca2fb65a0da864141ffff7b.tar.gz
CMake-888c8af6cbfcbaffeca2fb65a0da864141ffff7b.tar.bz2
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.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx21
1 files 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<cmSourceFile*> sources;
- if (!gt->GetConfigCommonSourceFiles(sources)) {
- return;
- }
+ std::vector<cmSourceFile const*> objs;
+ gt->GetExternalObjects(objs, configName);
const char* sep = isep ? isep : "";
- for (std::vector<cmSourceFile*>::const_iterator i = sources.begin();
- i != sources.end(); i++) {
+ for (std::vector<cmSourceFile const*>::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);