From 94fd5a5af87adafbbf7f47d6d083b53c6bd3e941 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 23 Oct 2015 18:26:40 +0200 Subject: [PATCH] VS: Port ImplibDir to cmGeneratorTarget --- Source/cmLocalVisualStudio6Generator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 2 +- Source/cmLocalVisualStudioGenerator.cxx | 12 +++++------- Source/cmLocalVisualStudioGenerator.h | 3 ++- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index c4cbdef39..d5abf68f7 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -841,7 +841,7 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmGeneratorTarget *target, event.Write(target->Target->GetPreBuildCommands()); event.Write(target->Target->GetPreLinkCommands()); cmsys::auto_ptr pcc( - this->MaybeCreateImplibDir(*target->Target, configName, false)); + this->MaybeCreateImplibDir(target, configName, false)); if(pcc.get()) { event.Write(*pcc); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 8b1915a3b..a2d4d16b0 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -2048,7 +2048,7 @@ void cmLocalVisualStudio7Generator event.Write(target->Target->GetPreLinkCommands()); } cmsys::auto_ptr pcc( - this->MaybeCreateImplibDir(*target->Target, + this->MaybeCreateImplibDir(target, configName, this->FortranProject)); if(pcc.get()) { diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index 8516ce7cb..561f9a136 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -80,7 +80,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames( //---------------------------------------------------------------------------- cmsys::auto_ptr -cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target, +cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget* target, const std::string& config, bool isFortran) { @@ -89,13 +89,11 @@ cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target, // If an executable exports symbols then VS wants to create an // import library but forgets to create the output directory. // The Intel Fortran plugin always forgets to the directory. - if(target.GetType() != cmState::EXECUTABLE && - !(isFortran && target.GetType() == cmState::SHARED_LIBRARY)) + if(target->GetType() != cmState::EXECUTABLE && + !(isFortran && target->GetType() == cmState::SHARED_LIBRARY)) { return pcc; } - cmGeneratorTarget* gt = - this->GetGlobalGenerator()->GetGeneratorTarget(&target); - std::string outDir = gt->GetDirectory(config, false); - std::string impDir = gt->GetDirectory(config, true); + std::string outDir = target->GetDirectory(config, false); + std::string impDir = target->GetDirectory(config, true); if(impDir == outDir) { return pcc; } // Add a pre-build event to create the directory. diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h index 6d915e7c2..f95eefaed 100644 --- a/Source/cmLocalVisualStudioGenerator.h +++ b/Source/cmLocalVisualStudioGenerator.h @@ -59,7 +59,8 @@ protected: /** Construct a custom command to make exe import lib dir. */ cmsys::auto_ptr - MaybeCreateImplibDir(cmTarget& target, const std::string& config, + MaybeCreateImplibDir(cmGeneratorTarget *target, + const std::string& config, bool isFortran); };