From abfa5f2d1fac0a55b430e078884ad1ae252d20cd Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 8 Jul 2015 15:02:11 -0400 Subject: cmCommonTargetGenerator: Adopt ConfigName member De-duplicate the member from the Makefile and Ninja target generators. --- Source/cmCommonTargetGenerator.cxx | 6 ++++++ Source/cmCommonTargetGenerator.h | 3 +++ Source/cmMakefileTargetGenerator.cxx | 1 - Source/cmMakefileTargetGenerator.h | 1 - Source/cmNinjaTargetGenerator.cxx | 5 ----- Source/cmNinjaTargetGenerator.h | 2 -- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 9d10e39..3edeff3 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -23,9 +23,15 @@ cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt) , LocalGenerator(static_cast(gt->LocalGenerator)) , GlobalGenerator(static_cast( gt->LocalGenerator->GetGlobalGenerator())) + , ConfigName(LocalGenerator->GetConfigName()) { } cmCommonTargetGenerator::~cmCommonTargetGenerator() { } + +std::string const& cmCommonTargetGenerator::GetConfigName() const +{ + return this->ConfigName; +} diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index e39f2c8..bf2add3 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -29,12 +29,15 @@ public: cmCommonTargetGenerator(cmGeneratorTarget* gt); virtual ~cmCommonTargetGenerator(); + std::string const& GetConfigName() const; + protected: cmGeneratorTarget* GeneratorTarget; cmTarget* Target; cmMakefile* Makefile; cmLocalCommonGenerator* LocalGenerator; cmGlobalCommonGenerator* GlobalGenerator; + std::string ConfigName; }; #endif diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 3371381..5c9402e 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -44,7 +44,6 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target) this->FortranModuleDirectoryComputed = false; this->LocalGenerator = static_cast(target->GetLocalGenerator()); - this->ConfigName = this->LocalGenerator->GetConfigName().c_str(); this->GlobalGenerator = static_cast( this->LocalGenerator->GetGlobalGenerator()); diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index 787f246..2985f4e 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -177,7 +177,6 @@ protected: std::string& linkFlags); cmLocalUnixMakefileGenerator3 *LocalGenerator; cmGlobalUnixMakefileGenerator3 *GlobalGenerator; - std::string ConfigName; enum CustomCommandDriveType { OnBuild, OnDepends, OnUtility }; CustomCommandDriveType CustomCommandDriver; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 5ede08a..152bf7c 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -89,11 +89,6 @@ cmGlobalNinjaGenerator* cmNinjaTargetGenerator::GetGlobalGenerator() const return this->LocalGenerator->GetGlobalNinjaGenerator(); } -std::string const& cmNinjaTargetGenerator::GetConfigName() const -{ - return this->LocalGenerator->GetConfigName(); -} - std::string cmNinjaTargetGenerator::LanguageCompilerRule( const std::string& lang) const { diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index 87ba17f..e446876 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -67,8 +67,6 @@ protected: cmMakefile* GetMakefile() const { return this->Makefile; } - std::string const& GetConfigName() const; - std::string LanguageCompilerRule(const std::string& lang) const; const char* GetFeature(const std::string& feature); -- cgit v0.12