summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-03-12 14:55:07 (GMT)
committerBrad King <brad.king@kitware.com>2012-03-13 18:38:02 (GMT)
commit3a53005f7dd5e582b855ef1f3c0e6814ce7d024a (patch)
tree8119a26b0aed2e067055d2f5a76887560e703dc3 /Source/cmLocalVisualStudio7Generator.cxx
parent3aa741acb6b47d83a0892ddf027ddb0abdc33e78 (diff)
downloadCMake-3a53005f7dd5e582b855ef1f3c0e6814ce7d024a.zip
CMake-3a53005f7dd5e582b855ef1f3c0e6814ce7d024a.tar.gz
CMake-3a53005f7dd5e582b855ef1f3c0e6814ce7d024a.tar.bz2
Build object library targets in VS
Treat OBJECT libraries as STATIC libraries. The VS project file format provides no way to avoid running the librarian so hide the resulting .lib away next to the object files as it should never be referenced. The object files will be left behind for reference by other targets later.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index ee54433..2f145a6 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -642,6 +642,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
bool targetBuilds = true;
switch(target.GetType())
{
+ case cmTarget::OBJECT_LIBRARY:
+ targetBuilds = false; // TODO: PDB for object library?
case cmTarget::STATIC_LIBRARY:
projectType = "typeStaticLibrary";
configType = "4";
@@ -1001,6 +1003,22 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
}
switch(target.GetType())
{
+ case cmTarget::OBJECT_LIBRARY:
+ {
+ std::string libpath = this->GetTargetDirectory(target);
+ libpath += "/";
+ libpath += configName;
+ libpath += "/";
+ libpath += target.GetName();
+ libpath += ".lib";
+ const char* tool =
+ this->FortranProject? "VFLibrarianTool":"VCLibrarianTool";
+ fout << "\t\t\t<Tool\n"
+ << "\t\t\t\tName=\"" << tool << "\"\n";
+ fout << "\t\t\t\tOutputFile=\""
+ << this->ConvertToXMLOutputPathSingle(libpath.c_str()) << "\"/>\n";
+ break;
+ }
case cmTarget::STATIC_LIBRARY:
{
std::string targetNameFull = target.GetFullName(configName);