VS: Port ImplibDir to cmGeneratorTarget

This commit is contained in:
Stephen Kelly 2015-10-23 18:26:40 +02:00
parent ce9e9a92cf
commit 94fd5a5af8
4 changed files with 9 additions and 10 deletions

@ -841,7 +841,7 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmGeneratorTarget *target,
event.Write(target->Target->GetPreBuildCommands()); event.Write(target->Target->GetPreBuildCommands());
event.Write(target->Target->GetPreLinkCommands()); event.Write(target->Target->GetPreLinkCommands());
cmsys::auto_ptr<cmCustomCommand> pcc( cmsys::auto_ptr<cmCustomCommand> pcc(
this->MaybeCreateImplibDir(*target->Target, configName, false)); this->MaybeCreateImplibDir(target, configName, false));
if(pcc.get()) if(pcc.get())
{ {
event.Write(*pcc); event.Write(*pcc);

@ -2048,7 +2048,7 @@ void cmLocalVisualStudio7Generator
event.Write(target->Target->GetPreLinkCommands()); event.Write(target->Target->GetPreLinkCommands());
} }
cmsys::auto_ptr<cmCustomCommand> pcc( cmsys::auto_ptr<cmCustomCommand> pcc(
this->MaybeCreateImplibDir(*target->Target, this->MaybeCreateImplibDir(target,
configName, this->FortranProject)); configName, this->FortranProject));
if(pcc.get()) if(pcc.get())
{ {

@ -80,7 +80,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmsys::auto_ptr<cmCustomCommand> cmsys::auto_ptr<cmCustomCommand>
cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target, cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget* target,
const std::string& config, const std::string& config,
bool isFortran) bool isFortran)
{ {
@ -89,13 +89,11 @@ cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target,
// If an executable exports symbols then VS wants to create an // If an executable exports symbols then VS wants to create an
// import library but forgets to create the output directory. // import library but forgets to create the output directory.
// The Intel Fortran plugin always forgets to the directory. // The Intel Fortran plugin always forgets to the directory.
if(target.GetType() != cmState::EXECUTABLE && if(target->GetType() != cmState::EXECUTABLE &&
!(isFortran && target.GetType() == cmState::SHARED_LIBRARY)) !(isFortran && target->GetType() == cmState::SHARED_LIBRARY))
{ return pcc; } { return pcc; }
cmGeneratorTarget* gt = std::string outDir = target->GetDirectory(config, false);
this->GetGlobalGenerator()->GetGeneratorTarget(&target); std::string impDir = target->GetDirectory(config, true);
std::string outDir = gt->GetDirectory(config, false);
std::string impDir = gt->GetDirectory(config, true);
if(impDir == outDir) { return pcc; } if(impDir == outDir) { return pcc; }
// Add a pre-build event to create the directory. // Add a pre-build event to create the directory.

@ -59,7 +59,8 @@ protected:
/** Construct a custom command to make exe import lib dir. */ /** Construct a custom command to make exe import lib dir. */
cmsys::auto_ptr<cmCustomCommand> cmsys::auto_ptr<cmCustomCommand>
MaybeCreateImplibDir(cmTarget& target, const std::string& config, MaybeCreateImplibDir(cmGeneratorTarget *target,
const std::string& config,
bool isFortran); bool isFortran);
}; };