mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-20 21:40:15 +08:00
Fix the path used for ignoring system warnings
This commit is contained in:
@@ -1766,13 +1766,12 @@ bool cmMakefile::CheckForUnused(const char* reason, const char* name)
|
|||||||
{
|
{
|
||||||
if (this->WarnUnused && !this->VariableUsed(name))
|
if (this->WarnUnused && !this->VariableUsed(name))
|
||||||
{
|
{
|
||||||
const char* cdir = this->ListFileStack.back().c_str();
|
const cmListFileContext* file = this->CallStack.back().Context;
|
||||||
if (this->CheckSystemVars ||
|
if (this->CheckSystemVars ||
|
||||||
cmSystemTools::IsSubDirectory(cdir, this->GetHomeDirectory()) ||
|
cmSystemTools::IsSubDirectory(file->FilePath.c_str(), this->GetHomeDirectory()) ||
|
||||||
cmSystemTools::IsSubDirectory(cdir, this->GetHomeOutputDirectory()))
|
cmSystemTools::IsSubDirectory(file->FilePath.c_str(), this->GetHomeOutputDirectory()))
|
||||||
{
|
{
|
||||||
cmOStringStream msg;
|
cmOStringStream msg;
|
||||||
const cmListFileContext* file = this->CallStack.back().Context;
|
|
||||||
msg << file->FilePath << ":" << file->Line << ":" <<
|
msg << file->FilePath << ":" << file->Line << ":" <<
|
||||||
" warning: (" << reason << ") unused variable \'" << name << "\'";
|
" warning: (" << reason << ") unused variable \'" << name << "\'";
|
||||||
cmSystemTools::Message(msg.str().c_str());
|
cmSystemTools::Message(msg.str().c_str());
|
||||||
|
Reference in New Issue
Block a user