stringapi: Use strings for feature arguments
This commit is contained in:
parent
acb116e3b5
commit
3def29da3c
|
@ -3801,7 +3801,7 @@ bool cmMakefile::GetPropertyAsBool(const std::string& prop) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
const char* cmMakefile::GetFeature(const char* feature,
|
const char* cmMakefile::GetFeature(const std::string& feature,
|
||||||
const std::string& config)
|
const std::string& config)
|
||||||
{
|
{
|
||||||
// TODO: Define accumulation policy for features (prepend, append, replace).
|
// TODO: Define accumulation policy for features (prepend, append, replace).
|
||||||
|
|
|
@ -811,7 +811,8 @@ public:
|
||||||
cmProperty::ScopeType scope) const;
|
cmProperty::ScopeType scope) const;
|
||||||
bool GetPropertyAsBool(const std::string& prop) const;
|
bool GetPropertyAsBool(const std::string& prop) const;
|
||||||
|
|
||||||
const char* GetFeature(const char* feature, const std::string& config);
|
const char* GetFeature(const std::string& feature,
|
||||||
|
const std::string& config);
|
||||||
|
|
||||||
// Get the properties
|
// Get the properties
|
||||||
cmPropertyMap &GetProperties() { return this->Properties; };
|
cmPropertyMap &GetProperties() { return this->Properties; };
|
||||||
|
|
|
@ -2105,13 +2105,13 @@ void cmMakefileTargetGenerator::AddModuleDefinitionFlag(std::string& flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
const char* cmMakefileTargetGenerator::GetFeature(const char* feature)
|
const char* cmMakefileTargetGenerator::GetFeature(const std::string& feature)
|
||||||
{
|
{
|
||||||
return this->Target->GetFeature(feature, this->ConfigName);
|
return this->Target->GetFeature(feature, this->ConfigName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool cmMakefileTargetGenerator::GetFeatureAsBool(const char* feature)
|
bool cmMakefileTargetGenerator::GetFeatureAsBool(const std::string& feature)
|
||||||
{
|
{
|
||||||
return cmSystemTools::IsOn(this->GetFeature(feature));
|
return cmSystemTools::IsOn(this->GetFeature(feature));
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,8 +263,8 @@ protected:
|
||||||
void AddFeatureFlags(std::string& flags, const std::string& lang);
|
void AddFeatureFlags(std::string& flags, const std::string& lang);
|
||||||
|
|
||||||
// Feature query methods.
|
// Feature query methods.
|
||||||
const char* GetFeature(const char* feature);
|
const char* GetFeature(const std::string& feature);
|
||||||
bool GetFeatureAsBool(const char* feature);
|
bool GetFeatureAsBool(const std::string& feature);
|
||||||
|
|
||||||
//==================================================================
|
//==================================================================
|
||||||
// Convenience routines that do nothing more than forward to
|
// Convenience routines that do nothing more than forward to
|
||||||
|
|
|
@ -97,13 +97,13 @@ std::string const& cmNinjaTargetGenerator::GetConfigName() const
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
|
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
|
||||||
const char* cmNinjaTargetGenerator::GetFeature(const char* feature)
|
const char* cmNinjaTargetGenerator::GetFeature(const std::string& feature)
|
||||||
{
|
{
|
||||||
return this->Target->GetFeature(feature, this->GetConfigName());
|
return this->Target->GetFeature(feature, this->GetConfigName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
|
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
|
||||||
bool cmNinjaTargetGenerator::GetFeatureAsBool(const char* feature)
|
bool cmNinjaTargetGenerator::GetFeatureAsBool(const std::string& feature)
|
||||||
{
|
{
|
||||||
return cmSystemTools::IsOn(this->GetFeature(feature));
|
return cmSystemTools::IsOn(this->GetFeature(feature));
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,8 @@ protected:
|
||||||
std::string LanguageCompilerRule(const std::string& lang) const
|
std::string LanguageCompilerRule(const std::string& lang) const
|
||||||
{ return lang + "_COMPILER"; }
|
{ return lang + "_COMPILER"; }
|
||||||
|
|
||||||
const char* GetFeature(const char* feature);
|
const char* GetFeature(const std::string& feature);
|
||||||
bool GetFeatureAsBool(const char* feature);
|
bool GetFeatureAsBool(const std::string& feature);
|
||||||
void AddFeatureFlags(std::string& flags, const std::string& lang);
|
void AddFeatureFlags(std::string& flags, const std::string& lang);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2549,7 +2549,7 @@ void cmTarget::GetTargetVersion(bool soversion,
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
const char* cmTarget::GetFeature(const char* feature,
|
const char* cmTarget::GetFeature(const std::string& feature,
|
||||||
const std::string& config) const
|
const std::string& config) const
|
||||||
{
|
{
|
||||||
if(!config.empty())
|
if(!config.empty())
|
||||||
|
|
|
@ -232,7 +232,7 @@ public:
|
||||||
bool GetPropertyAsBool(const std::string& prop) const;
|
bool GetPropertyAsBool(const std::string& prop) const;
|
||||||
void CheckProperty(const std::string& prop, cmMakefile* context) const;
|
void CheckProperty(const std::string& prop, cmMakefile* context) const;
|
||||||
|
|
||||||
const char* GetFeature(const char* feature,
|
const char* GetFeature(const std::string& feature,
|
||||||
const std::string& config) const;
|
const std::string& config) const;
|
||||||
|
|
||||||
bool IsImported() const {return this->IsImportedTarget;}
|
bool IsImported() const {return this->IsImportedTarget;}
|
||||||
|
|
Loading…
Reference in New Issue