summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio6Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-03-12 18:40:58 (GMT)
committerBrad King <brad.king@kitware.com>2012-03-16 14:12:15 (GMT)
commitc403f27a2de2327f5c895972e16a81d80968c40c (patch)
tree20836fe0e36e6ba3abaef61bf7ba394bfcbb02b8 /Source/cmLocalVisualStudio6Generator.cxx
parent3a53005f7dd5e582b855ef1f3c0e6814ce7d024a (diff)
downloadCMake-c403f27a2de2327f5c895972e16a81d80968c40c.zip
CMake-c403f27a2de2327f5c895972e16a81d80968c40c.tar.gz
CMake-c403f27a2de2327f5c895972e16a81d80968c40c.tar.bz2
Add $<TARGET_OBJECTS:...> expression to use an object library
For now do not allow an OBJECT library to reference other object libraries. Teach cmTarget::ComputeLinkImplementation to include the languages of object libraries used by a target.
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx36
1 files changed, 35 insertions, 1 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index f53ad0e..5b99dfd 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1428,6 +1428,16 @@ void cmLocalVisualStudio6Generator
staticLibOptionsRelWithDebInfo += " ";
staticLibOptionsRelWithDebInfo = libflagsRelWithDebInfo;
}
+ std::string objects;
+ this->OutputObjects(target, "LIB", objects);
+ if(!objects.empty())
+ {
+ objects = "\n" + objects;
+ staticLibOptionsDebug += objects;
+ staticLibOptionsRelease += objects;
+ staticLibOptionsMinSizeRel += objects;
+ staticLibOptionsRelWithDebInfo += objects;
+ }
}
// Add the export symbol definition for shared library objects.
@@ -1587,7 +1597,7 @@ void cmLocalVisualStudio6Generator
std::string flagsDebug = " ";
std::string flagsDebugRel = " ";
if(target.GetType() >= cmTarget::EXECUTABLE &&
- target.GetType() <= cmTarget::MODULE_LIBRARY)
+ target.GetType() <= cmTarget::OBJECT_LIBRARY)
{
const char* linkLanguage = target.GetLinkerLanguage();
if(!linkLanguage)
@@ -1742,6 +1752,8 @@ void cmLocalVisualStudio6Generator
ItemVector const& linkLibs = cli.GetItems();
std::vector<std::string> const& linkDirs = cli.GetDirectories();
+ this->OutputObjects(target, "LINK", options);
+
// Build the link options code.
for(std::vector<std::string>::const_iterator d = linkDirs.begin();
d != linkDirs.end(); ++d)
@@ -1786,6 +1798,28 @@ void cmLocalVisualStudio6Generator
}
}
+//----------------------------------------------------------------------------
+void cmLocalVisualStudio6Generator
+::OutputObjects(cmTarget& target, const char* tool,
+ std::string& options)
+{
+ // VS 6 does not support per-config source locations so we
+ // list object library content on the link line instead.
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&target);
+ std::vector<std::string> objs;
+ gt->UseObjectLibraries(objs);
+ for(std::vector<std::string>::const_iterator
+ oi = objs.begin(); oi != objs.end(); ++oi)
+ {
+ options += "# ADD ";
+ options += tool;
+ options += "32 ";
+ options += this->ConvertToOptionallyRelativeOutputPath(oi->c_str());
+ options += "\n";
+ }
+}
+
std::string
cmLocalVisualStudio6Generator
::GetTargetDirectory(cmTarget const&) const