When checking for variables, specify a reason
Allow reasons to begiven for checking for unused variables.
This commit is contained in:
parent
3f1121f722
commit
c18c977ce8
|
@ -832,7 +832,7 @@ void cmMakefile::ConfigureFinalPass()
|
|||
l->second.FinishConfigure();
|
||||
}
|
||||
|
||||
this->GetCMakeInstance()->RunCheckForUnusedVariables();
|
||||
this->GetCMakeInstance()->RunCheckForUnusedVariables("configure");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue