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* srcRoot = this->Makefile->GetDefinition("CMAKE_SOURCE_DIR");
|
||||||
const char* binRoot = this->Makefile->GetDefinition("CMAKE_BINARY_DIR");
|
const char* binRoot = this->Makefile->GetDefinition("CMAKE_BINARY_DIR");
|
||||||
if (this->CheckSystemVars || strstr(this->FileName, srcRoot) == this->FileName ||
|
if (this->CheckSystemVars ||
|
||||||
strstr(this->FileName, binRoot) == this->FileName)
|
cmSystemTools::IsSubDirectory(this->FileName, this->Makefile->GetHomeDirectory()) ||
|
||||||
|
cmSystemTools::IsSubDirectory(this->FileName, this->Makefile->GetHomeOutputDirectory()))
|
||||||
{
|
{
|
||||||
cmOStringStream msg;
|
cmOStringStream msg;
|
||||||
msg << this->FileName << ":" << this->FileLine << ":" <<
|
msg << this->FileName << ":" << this->FileLine << ":" <<
|
||||||
|
|
|
@ -3394,9 +3394,9 @@ void cmMakefile::PopScope()
|
||||||
if (this->WarnUnused && usage.find(*it) == usage.end())
|
if (this->WarnUnused && usage.find(*it) == usage.end())
|
||||||
{
|
{
|
||||||
const char* cdir = this->ListFileStack.back().c_str();
|
const char* cdir = this->ListFileStack.back().c_str();
|
||||||
const char* srcRoot = this->GetDefinition("CMAKE_SOURCE_DIR");
|
if (this->CheckSystemVars ||
|
||||||
const char* binRoot = this->GetDefinition("CMAKE_BINARY_DIR");
|
cmSystemTools::IsSubDirectory(cdir, this->GetHomeDirectory()) ||
|
||||||
if (this->CheckSystemVars || strstr(cdir, srcRoot) == cdir || strstr(cdir, binRoot) == cdir)
|
cmSystemTools::IsSubDirectory(cdir, this->GetHomeOutputDirectory()))
|
||||||
{
|
{
|
||||||
cmOStringStream m;
|
cmOStringStream m;
|
||||||
m << "unused variable \'" << *it << "\'";
|
m << "unused variable \'" << *it << "\'";
|
||||||
|
|
Loading…
Reference in New Issue