From b3f0e35308993de825f00ec18fc6559e6609c9b0 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 4 Aug 2015 19:19:51 +0200 Subject: cmGeneratorTarget: Move GetCompilePDBDirectory from cmTarget. --- Source/cmGeneratorTarget.cxx | 12 +++++++++++- Source/cmGeneratorTarget.h | 6 ++++++ Source/cmMakefileExecutableTargetGenerator.cxx | 2 +- Source/cmMakefileLibraryTargetGenerator.cxx | 2 +- Source/cmTarget.cxx | 16 ---------------- Source/cmTarget.h | 12 +++++------- 6 files changed, 24 insertions(+), 26 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index aac941e..c6f248c 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -743,7 +743,7 @@ cmGeneratorTarget::GetCompilePDBName(const std::string& config) const std::string cmGeneratorTarget::GetCompilePDBPath(const std::string& config) const { - std::string dir = this->Target->GetCompilePDBDirectory(config); + std::string dir = this->GetCompilePDBDirectory(config); std::string name = this->GetCompilePDBName(config); if(dir.empty() && !name.empty()) { @@ -1824,6 +1824,16 @@ void cmGeneratorTarget::TraceDependencies() tracer.Trace(); } +std::string +cmGeneratorTarget::GetCompilePDBDirectory(const std::string& config) const +{ + if(cmTarget::CompileInfo const* info = this->Target->GetCompileInfo(config)) + { + return info->CompilePdbDir; + } + return ""; +} + //---------------------------------------------------------------------------- void cmGeneratorTarget::GetAppleArchs(const std::string& config, std::vector& archVec) const diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 52ab6c0..3dbbca1 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -214,6 +214,12 @@ public: */ void TraceDependencies(); + /** Get the directory in which to place the target compiler .pdb file. + If the configuration name is given then the generator will add its + subdirectory for that configuration. Otherwise just the canonical + compiler pdb output directory is given. */ + std::string GetCompilePDBDirectory(const std::string& config = "") const; + /** Get sources that must be built before the given source. */ std::vector const* GetSourceDepends(cmSourceFile const* sf) const; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index afe145a..ccb0974 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -130,7 +130,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) } std::string compilePdbOutputPath = - this->Target->GetCompilePDBDirectory(this->ConfigName); + this->GeneratorTarget->GetCompilePDBDirectory(this->ConfigName); cmSystemTools::MakeDirectory(compilePdbOutputPath.c_str()); std::string pdbOutputPath = this->Target->GetPDBDirectory(this->ConfigName); diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index bb0f9dd..2f995e8 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -311,7 +311,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules } std::string compilePdbOutputPath = - this->Target->GetCompilePDBDirectory(this->ConfigName); + this->GeneratorTarget->GetCompilePDBDirectory(this->ConfigName); cmSystemTools::MakeDirectory(compilePdbOutputPath.c_str()); std::string pdbOutputPath = this->Target->GetPDBDirectory(this->ConfigName); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8b64bc4..9308113 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -69,12 +69,6 @@ struct cmTarget::OutputInfo }; //---------------------------------------------------------------------------- -struct cmTarget::CompileInfo -{ - std::string CompilePdbDir; -}; - -//---------------------------------------------------------------------------- class cmTargetInternals { public: @@ -2673,16 +2667,6 @@ std::string cmTarget::GetPDBDirectory(const std::string& config) const } //---------------------------------------------------------------------------- -std::string cmTarget::GetCompilePDBDirectory(const std::string& config) const -{ - if(CompileInfo const* info = this->GetCompileInfo(config)) - { - return info->CompilePdbDir; - } - return ""; -} - -//---------------------------------------------------------------------------- const char* cmTarget::ImportedGetLocation(const std::string& config) const { static std::string location; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a6f2465..8689838 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -334,12 +334,6 @@ public: pdb output directory is given. */ std::string GetPDBDirectory(const std::string& config) const; - /** Get the directory in which to place the target compiler .pdb file. - If the configuration name is given then the generator will add its - subdirectory for that configuration. Otherwise just the canonical - compiler pdb output directory is given. */ - std::string GetCompilePDBDirectory(const std::string& config = "") const; - const char* ImportedGetLocation(const std::string& config) const; /** Get the target major and minor version numbers interpreted from @@ -633,7 +627,11 @@ private: ImportInfo& info) const; // Cache target compile paths for each configuration. - struct CompileInfo; + struct CompileInfo + { + std::string CompilePdbDir; + }; + CompileInfo const* GetCompileInfo(const std::string& config) const; LinkInterface const* -- cgit v0.12