When checking for variables, specify a reason

Allow reasons to begiven for checking for unused variables.
This commit is contained in:
Ben Boeckel 2010-11-15 10:32:15 -05:00
parent 3f1121f722
commit c18c977ce8
3 changed files with 5 additions and 4 deletions

View File

@ -832,7 +832,7 @@ void cmMakefile::ConfigureFinalPass()
l->second.FinishConfigure();
}
this->GetCMakeInstance()->RunCheckForUnusedVariables();
this->GetCMakeInstance()->RunCheckForUnusedVariables("configure");
}
//----------------------------------------------------------------------------

View File

@ -4494,7 +4494,7 @@ void cmake::WatchUnusedCli(const char* var)
#endif
}
void cmake::RunCheckForUnusedVariables() const
void cmake::RunCheckForUnusedVariables(const std::string& reason) const
{
#ifdef CMAKE_BUILD_WITH_CMAKE
if(this->WarnUnusedCli)
@ -4506,7 +4506,8 @@ void cmake::RunCheckForUnusedVariables() const
if(!it->second)
{
std::string message = "warning: The variable, '" + it->first +
"', given on the command line, was not used within the build.";
"', given on the command line, was not used during the " + reason +
".";
cmSystemTools::Message(message.c_str());
}
}

View File

@ -365,7 +365,7 @@ class cmake
bool clean);
void WatchUnusedCli(const char* var);
void RunCheckForUnusedVariables() const;
void RunCheckForUnusedVariables(const std::string& reason) const;
protected:
void InitializeProperties();
int HandleDeleteCacheVariables(const char* var);