From 709fa59562569b6c6a8244f5ba53b60ebf840a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Wed, 22 Aug 2012 12:42:16 +0200 Subject: [PATCH] Ninja: remove GetTargetPDB because it is used only once --- Source/cmNinjaTargetGenerator.cxx | 27 +++++++++++---------------- Source/cmNinjaTargetGenerator.h | 1 - 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index b89602e2fc..0256aa93ef 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -295,21 +295,6 @@ std::string cmNinjaTargetGenerator::GetTargetName() const return this->Target->GetName(); } -std::string cmNinjaTargetGenerator::GetTargetPDB() const -{ - std::string targetFullPathPDB; - if(this->Target->GetType() == cmTarget::EXECUTABLE || - this->Target->GetType() == cmTarget::STATIC_LIBRARY || - this->Target->GetType() == cmTarget::SHARED_LIBRARY || - this->Target->GetType() == cmTarget::MODULE_LIBRARY) - { - targetFullPathPDB = this->Target->GetDirectory(this->GetConfigName()); - targetFullPathPDB += "/"; - targetFullPathPDB += this->Target->GetPDBName(this->GetConfigName()); - } - - return targetFullPathPDB.c_str(); -} bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const { @@ -317,7 +302,17 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") || mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID")) { - const std::string pdbPath = this->GetTargetPDB(); + std::string pdbPath; + if(this->Target->GetType() == cmTarget::EXECUTABLE || + this->Target->GetType() == cmTarget::STATIC_LIBRARY || + this->Target->GetType() == cmTarget::SHARED_LIBRARY || + this->Target->GetType() == cmTarget::MODULE_LIBRARY) + { + pdbPath = this->Target->GetDirectory(this->GetConfigName()); + pdbPath += "/"; + pdbPath += this->Target->GetPDBName(this->GetConfigName()); + } + vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat( ConvertToNinjaPath(pdbPath.c_str()).c_str(), cmLocalGenerator::SHELL); diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index 0c52fc4099..cd20694b4f 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -40,7 +40,6 @@ public: virtual void Generate() = 0; - std::string GetTargetPDB() const; std::string GetTargetName() const; protected: