summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-02-18 20:37:23 (GMT)
committerBrad King <brad.king@kitware.com>2006-02-18 20:37:23 (GMT)
commit81677b31300f058830889e5603bf06ccd9221691 (patch)
tree35946600211458cb15f8269b2a5a607f43ecfc64 /Source/cmMakefileLibraryTargetGenerator.cxx
parent9ba02838701e2513414f258dec9d63566ee9b481 (diff)
downloadCMake-81677b31300f058830889e5603bf06ccd9221691.zip
CMake-81677b31300f058830889e5603bf06ccd9221691.tar.gz
CMake-81677b31300f058830889e5603bf06ccd9221691.tar.bz2
ENH: Generate import libraries for DLLs on Cygwin and MinGW.
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx36
1 files changed, 29 insertions, 7 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 206b49d..9f5ce12 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -202,8 +202,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::string targetName;
std::string targetNameSO;
std::string targetNameReal;
- this->Target->GetLibraryNames(targetName, targetNameSO, targetNameReal,
- this->LocalGenerator->m_ConfigurationName.c_str());
+ std::string targetNameImport;
+ this->Target->GetLibraryNames(
+ targetName, targetNameSO, targetNameReal, targetNameImport,
+ this->LocalGenerator->m_ConfigurationName.c_str());
// Construct the full path version of the names.
std::string outpath = this->LocalGenerator->m_LibraryOutputPath;
@@ -222,6 +224,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::string targetFullPath = outpath + targetName;
std::string targetFullPathSO = outpath + targetNameSO;
std::string targetFullPathReal = outpath + targetNameReal;
+ std::string targetFullPathImport = outpath + targetNameImport;
// Construct the output path version of the names for use in command
// arguments.
@@ -234,6 +237,9 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::string targetOutPathReal =
this->Convert(targetFullPathReal.c_str(),cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::MAKEFILE);
+ std::string targetOutPathImport =
+ this->Convert(targetFullPathImport.c_str(),cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::MAKEFILE);
// Add the link message.
std::string buildEcho = "Linking ";
@@ -260,15 +266,19 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::string cleanSharedName;
std::string cleanSharedSOName;
std::string cleanSharedRealName;
- this->Target->GetLibraryCleanNames(cleanStaticName,
- cleanSharedName,
- cleanSharedSOName,
- cleanSharedRealName,
- this->LocalGenerator->m_ConfigurationName.c_str());
+ std::string cleanImportName;
+ this->Target->GetLibraryCleanNames(
+ cleanStaticName,
+ cleanSharedName,
+ cleanSharedSOName,
+ cleanSharedRealName,
+ cleanImportName,
+ this->LocalGenerator->m_ConfigurationName.c_str());
std::string cleanFullStaticName = outpath + cleanStaticName;
std::string cleanFullSharedName = outpath + cleanSharedName;
std::string cleanFullSharedSOName = outpath + cleanSharedSOName;
std::string cleanFullSharedRealName = outpath + cleanSharedRealName;
+ std::string cleanFullImportName = outpath + cleanImportName;
libCleanFiles.push_back
(this->Convert(cleanFullStaticName.c_str(),cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::MAKEFILE));
@@ -293,6 +303,16 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::MAKEFILE));
}
+ if(!cleanImportName.empty() &&
+ cleanImportName != cleanStaticName &&
+ cleanImportName != cleanSharedSOName &&
+ cleanImportName != cleanSharedRealName &&
+ cleanImportName != cleanSharedName)
+ {
+ libCleanFiles.push_back(this->Convert(cleanFullImportName.c_str(),
+ cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::MAKEFILE));
+ }
}
// Add a command to remove any existing files for this library.
std::vector<std::string> commands1;
@@ -363,6 +383,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
cleanObjs += ")";
// Expand placeholders in the commands.
+ this->LocalGenerator->m_TargetImplib = targetOutPathImport;
for(std::vector<std::string>::iterator i = commands.begin();
i != commands.end(); ++i)
{
@@ -375,6 +396,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
targetNameSO.c_str(),
linkFlags.c_str());
}
+ this->LocalGenerator->m_TargetImplib = "";
// Write the build rule.
this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,