diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-06-06 13:42:31 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-06-06 13:44:17 (GMT) |
commit | f573bd22e4049746b53789fc0502cff8423dbe56 (patch) | |
tree | c165e4e8a08f46e61388cadf1071e0a0c82833ea /Source | |
parent | ccbc2259137fe61a770bb0b5538a20bf5e00bc8f (diff) | |
download | CMake-f573bd22e4049746b53789fc0502cff8423dbe56.zip CMake-f573bd22e4049746b53789fc0502cff8423dbe56.tar.gz CMake-f573bd22e4049746b53789fc0502cff8423dbe56.tar.bz2 |
cmLocalGenerator: Add Feature API from cmMakefile.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 2 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 27 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 3 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 27 | ||||
-rw-r--r-- | Source/cmMakefile.h | 3 |
5 files changed, 31 insertions, 31 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 4901820..67d0d54 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -370,7 +370,7 @@ const char* cmGeneratorTarget::GetFeature(const std::string& feature, { return value; } - return this->Makefile->GetFeature(feature, config); + return this->LocalGenerator->GetFeature(feature, config); } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index da95a4d..899da56 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2573,6 +2573,33 @@ void cmLocalGenerator::AppendFeatureOptions( } //---------------------------------------------------------------------------- +const char* cmLocalGenerator::GetFeature(const std::string& feature, + const std::string& config) +{ + // TODO: Define accumulation policy for features (prepend, append, replace). + // Currently we always replace. + if(!config.empty()) + { + std::string featureConfig = feature; + featureConfig += "_"; + featureConfig += cmSystemTools::UpperCase(config); + if(const char* value = this->Makefile->GetProperty(featureConfig)) + { + return value; + } + } + if(const char* value = this->Makefile->GetProperty(feature)) + { + return value; + } + if(cmLocalGenerator* parent = this->GetParent()) + { + return parent->GetFeature(feature, config); + } + return 0; +} + +//---------------------------------------------------------------------------- std::string cmLocalGenerator::ConstructComment(cmCustomCommandGenerator const& ccg, const char* default_comment) diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 1359dd6..3e3b4bc 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -179,6 +179,9 @@ public: void AppendFeatureOptions(std::string& flags, const std::string& lang, const char* feature); + const char* GetFeature(const std::string& feature, + const std::string& config); + /** \brief Get absolute path to dependency \a name * * Translate a dependency as given in CMake code to the name to diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b5d976a..806dc52 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4215,33 +4215,6 @@ bool cmMakefile::GetPropertyAsBool(const std::string& prop) const return cmSystemTools::IsOn(this->GetProperty(prop)); } -//---------------------------------------------------------------------------- -const char* cmMakefile::GetFeature(const std::string& feature, - const std::string& config) -{ - // TODO: Define accumulation policy for features (prepend, append, replace). - // Currently we always replace. - if(!config.empty()) - { - std::string featureConfig = feature; - featureConfig += "_"; - featureConfig += cmSystemTools::UpperCase(config); - if(const char* value = this->GetProperty(featureConfig)) - { - return value; - } - } - if(const char* value = this->GetProperty(feature)) - { - return value; - } - if(cmLocalGenerator* parent = this->LocalGenerator->GetParent()) - { - return parent->GetMakefile()->GetFeature(feature, config); - } - return 0; -} - cmTarget* cmMakefile::FindTarget(const std::string& name, bool excludeAliases) const { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 431ed08..a601067 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -727,9 +727,6 @@ public: cmProperty::ScopeType scope) const; bool GetPropertyAsBool(const std::string& prop) const; - const char* GetFeature(const std::string& feature, - const std::string& config); - // Get the properties cmPropertyMap &GetProperties() { return this->Properties; } |