cmMakefile: Change CompileFeatureKnown to take target name instead of target

The implementation needs only the target name.
This commit is contained in:
Justin Goshi
2020-06-11 12:27:46 -07:00
committed by Brad King
parent 43b10e2411
commit 0892c798f7
3 changed files with 7 additions and 6 deletions

View File

@@ -1708,7 +1708,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
std::string error;
std::string lang;
if (!context->LG->GetMakefile()->CompileFeatureKnown(
context->HeadTarget->Target, p, lang, &error)) {
context->HeadTarget->Target->GetName(), p, lang, &error)) {
reportError(context, content->GetOriginalExpression(), error);
return std::string();
}

View File

@@ -4673,7 +4673,7 @@ bool cmMakefile::AddRequiredTargetFeature(cmTarget* target,
}
std::string lang;
if (!this->CompileFeatureKnown(target, feature, lang, error)) {
if (!this->CompileFeatureKnown(target->GetName(), feature, lang, error)) {
return false;
}
@@ -4710,7 +4710,7 @@ bool cmMakefile::AddRequiredTargetFeature(cmTarget* target,
return this->AddRequiredTargetCxxFeature(target, feature, lang, error);
}
bool cmMakefile::CompileFeatureKnown(cmTarget const* target,
bool cmMakefile::CompileFeatureKnown(const std::string& targetName,
const std::string& feature,
std::string& lang,
std::string* error) const
@@ -4747,7 +4747,7 @@ bool cmMakefile::CompileFeatureKnown(cmTarget const* target,
e << " unknown feature \"" << feature
<< "\" for "
"target \""
<< target->GetName() << "\".";
<< targetName << "\".";
if (error) {
*error = e.str();
} else {

View File

@@ -928,8 +928,9 @@ public:
bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature,
std::string* error = nullptr) const;
bool CompileFeatureKnown(cmTarget const* target, const std::string& feature,
std::string& lang, std::string* error) const;
bool CompileFeatureKnown(const std::string& targetName,
const std::string& feature, std::string& lang,
std::string* error) const;
const char* CompileFeaturesAvailable(const std::string& lang,
std::string* error) const;