From ade20b433b2ce1cf176bc727a8ed9c47a5f6537e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 11 Apr 2015 12:04:05 +0200 Subject: cmake: Remove DebugConfigs member. It adds needless complexity to global property handling. --- Source/cmTarget.cxx | 4 +-- Source/cmTargetLinkLibrariesCommand.cxx | 2 +- Source/cmake.cxx | 45 +++++++++++---------------------- Source/cmake.h | 3 +-- 4 files changed, 19 insertions(+), 35 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 85e5165..745a84c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1157,7 +1157,7 @@ cmTarget::LinkLibraryType cmTarget::ComputeLinkType( } // Get the list of configurations considered to be DEBUG. - std::vector const& debugConfigs = + std::vector debugConfigs = this->Makefile->GetCMakeInstance()->GetDebugConfigs(); // Check if any entry in the list matches this configuration. @@ -1216,7 +1216,7 @@ std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value, } // Get the list of configurations considered to be DEBUG. - std::vector const& debugConfigs = + std::vector debugConfigs = this->Makefile->GetCMakeInstance()->GetDebugConfigs(); std::string configString = "$"; diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 75c94c5..9be7d46 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -467,7 +467,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, } // Get the list of configurations considered to be DEBUG. - std::vector const& debugConfigs = + std::vector debugConfigs = this->Makefile->GetCMakeInstance()->GetDebugConfigs(); std::string prop; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index d2331cb..bef8904 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2283,24 +2283,12 @@ bool cmake::IsPropertyChained(const std::string& name, void cmake::SetProperty(const std::string& prop, const char* value) { - // Special hook to invalidate cached value. - if(prop == "DEBUG_CONFIGURATIONS") - { - this->DebugConfigs.clear(); - } - this->Properties.SetProperty(prop, value, cmProperty::GLOBAL); } void cmake::AppendProperty(const std::string& prop, const char* value, bool asString) { - // Special hook to invalidate cached value. - if(prop == "DEBUG_CONFIGURATIONS") - { - this->DebugConfigs.clear(); - } - this->Properties.AppendProperty(prop, value, cmProperty::GLOBAL, asString); } @@ -2758,27 +2746,24 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, } //---------------------------------------------------------------------------- -std::vector const& cmake::GetDebugConfigs() +std::vector cmake::GetDebugConfigs() { - // Compute on-demand. - if(this->DebugConfigs.empty()) + std::vector configs; + if(const char* config_list = this->GetProperty("DEBUG_CONFIGURATIONS")) { - if(const char* config_list = this->GetProperty("DEBUG_CONFIGURATIONS")) - { - // Expand the specified list and convert to upper-case. - cmSystemTools::ExpandListArgument(config_list, this->DebugConfigs); - std::transform(this->DebugConfigs.begin(), - this->DebugConfigs.end(), - this->DebugConfigs.begin(), - cmSystemTools::UpperCase); - } - // If no configurations were specified, use a default list. - if(this->DebugConfigs.empty()) - { - this->DebugConfigs.push_back("DEBUG"); - } + // Expand the specified list and convert to upper-case. + cmSystemTools::ExpandListArgument(config_list, configs); + std::transform(configs.begin(), + configs.end(), + configs.begin(), + cmSystemTools::UpperCase); + } + // If no configurations were specified, use a default list. + if(configs.empty()) + { + configs.push_back("DEBUG"); } - return this->DebugConfigs; + return configs; } diff --git a/Source/cmake.h b/Source/cmake.h index d2d3a85..0c3de65 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -359,7 +359,7 @@ class cmake /** Get the list of configurations (in upper case) considered to be debugging configurations.*/ - std::vector const& GetDebugConfigs(); + std::vector GetDebugConfigs(); void SetCMakeEditCommand(std::string const& s) { this->CMakeEditCommand = s; } @@ -469,7 +469,6 @@ private: bool DebugTryCompile; cmFileTimeComparison* FileComparison; std::string GraphVizFile; - std::vector DebugConfigs; InstalledFilesMap InstalledFiles; void UpdateConversionPathTable(); -- cgit v0.12