cmTarget: Add GetFeatureAsBool method
Return the GetFeature method result converted to a boolean value.
This commit is contained in:
parent
f7654a07d5
commit
c2eeb08b06
|
@ -2105,7 +2105,7 @@ const char* cmMakefileTargetGenerator::GetFeature(const std::string& feature)
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool cmMakefileTargetGenerator::GetFeatureAsBool(const std::string& feature)
|
bool cmMakefileTargetGenerator::GetFeatureAsBool(const std::string& feature)
|
||||||
{
|
{
|
||||||
return cmSystemTools::IsOn(this->GetFeature(feature));
|
return this->Target->GetFeatureAsBool(feature, this->ConfigName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
|
@ -105,7 +105,7 @@ const char* cmNinjaTargetGenerator::GetFeature(const std::string& feature)
|
||||||
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
|
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
|
||||||
bool cmNinjaTargetGenerator::GetFeatureAsBool(const std::string& feature)
|
bool cmNinjaTargetGenerator::GetFeatureAsBool(const std::string& feature)
|
||||||
{
|
{
|
||||||
return cmSystemTools::IsOn(this->GetFeature(feature));
|
return this->Target->GetFeatureAsBool(feature, this->GetConfigName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
|
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
|
||||||
|
|
|
@ -3180,6 +3180,13 @@ const char* cmTarget::GetFeature(const std::string& feature,
|
||||||
return this->Makefile->GetFeature(feature, config);
|
return this->Makefile->GetFeature(feature, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool cmTarget::GetFeatureAsBool(const std::string& feature,
|
||||||
|
const std::string& config) const
|
||||||
|
{
|
||||||
|
return cmSystemTools::IsOn(this->GetFeature(feature, config));
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
|
bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -237,6 +237,8 @@ public:
|
||||||
|
|
||||||
const char* GetFeature(const std::string& feature,
|
const char* GetFeature(const std::string& feature,
|
||||||
const std::string& config) const;
|
const std::string& config) const;
|
||||||
|
bool GetFeatureAsBool(const std::string& feature,
|
||||||
|
const std::string& config) const;
|
||||||
|
|
||||||
bool IsImported() const {return this->IsImportedTarget;}
|
bool IsImported() const {return this->IsImportedTarget;}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue