Browse Source

Fix the path used for ignoring system warnings

Ben Boeckel 15 years ago
parent
commit
ae3eff35b4
1 changed files with 3 additions and 4 deletions
  1. 3 4
      Source/cmMakefile.cxx

+ 3 - 4
Source/cmMakefile.cxx

@@ -1766,13 +1766,12 @@ bool cmMakefile::CheckForUnused(const char* reason, const char* 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 ||
-        cmSystemTools::IsSubDirectory(cdir, this->GetHomeDirectory()) ||
-        cmSystemTools::IsSubDirectory(cdir, this->GetHomeOutputDirectory()))
+        cmSystemTools::IsSubDirectory(file->FilePath.c_str(), this->GetHomeDirectory()) ||
+        cmSystemTools::IsSubDirectory(file->FilePath.c_str(), this->GetHomeOutputDirectory()))
       {
       cmOStringStream msg;
-      const cmListFileContext* file = this->CallStack.back().Context;
       msg << file->FilePath << ":" << file->Line << ":" <<
         " warning: (" << reason << ") unused variable \'" << name << "\'";
       cmSystemTools::Message(msg.str().c_str());