Use built-ins for readability and maintainability
This commit is contained in:
parent
8b520158c3
commit
3801463c9f
|
@ -132,8 +132,9 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
|
|||
{
|
||||
const char* srcRoot = this->Makefile->GetDefinition("CMAKE_SOURCE_DIR");
|
||||
const char* binRoot = this->Makefile->GetDefinition("CMAKE_BINARY_DIR");
|
||||
if (this->CheckSystemVars || strstr(this->FileName, srcRoot) == this->FileName ||
|
||||
strstr(this->FileName, binRoot) == this->FileName)
|
||||
if (this->CheckSystemVars ||
|
||||
cmSystemTools::IsSubDirectory(this->FileName, this->Makefile->GetHomeDirectory()) ||
|
||||
cmSystemTools::IsSubDirectory(this->FileName, this->Makefile->GetHomeOutputDirectory()))
|
||||
{
|
||||
cmOStringStream msg;
|
||||
msg << this->FileName << ":" << this->FileLine << ":" <<
|
||||
|
|
|
@ -778,7 +778,7 @@ void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg)
|
|||
this->Internal->VarUsageStack.push(std::set<cmStdString>());
|
||||
}
|
||||
}
|
||||
this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
|
||||
this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
|
||||
}
|
||||
|
||||
bool cmMakefile::NeedBackwardsCompatibility(unsigned int major,
|
||||
|
@ -3394,9 +3394,9 @@ void cmMakefile::PopScope()
|
|||
if (this->WarnUnused && usage.find(*it) == usage.end())
|
||||
{
|
||||
const char* cdir = this->ListFileStack.back().c_str();
|
||||
const char* srcRoot = this->GetDefinition("CMAKE_SOURCE_DIR");
|
||||
const char* binRoot = this->GetDefinition("CMAKE_BINARY_DIR");
|
||||
if (this->CheckSystemVars || strstr(cdir, srcRoot) == cdir || strstr(cdir, binRoot) == cdir)
|
||||
if (this->CheckSystemVars ||
|
||||
cmSystemTools::IsSubDirectory(cdir, this->GetHomeDirectory()) ||
|
||||
cmSystemTools::IsSubDirectory(cdir, this->GetHomeOutputDirectory()))
|
||||
{
|
||||
cmOStringStream m;
|
||||
m << "unused variable \'" << *it << "\'";
|
||||
|
|
Loading…
Reference in New Issue