cmPolicies: Make private method file-static.

This commit is contained in:
Stephen Kelly 2015-05-03 10:10:35 +02:00
parent cb765af049
commit e3a8c0291e
2 changed files with 27 additions and 31 deletions

View File

@ -466,6 +466,31 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
status);
}
//----------------------------------------------------------------------------
static void DiagnoseAncientPolicies(
std::vector<cmPolicies::PolicyID> const& ancient,
unsigned int majorVer,
unsigned int minorVer,
unsigned int patchVer,
cmMakefile* mf)
{
std::ostringstream e;
e << "The project requests behavior compatible with CMake version \""
<< majorVer << "." << minorVer << "." << patchVer
<< "\", which requires the OLD behavior for some policies:\n";
for(std::vector<cmPolicies::PolicyID>::const_iterator
i = ancient.begin(); i != ancient.end(); ++i)
{
e << " " << idToString(*i) << ": " << idToShortDescription(*i) << "\n";
}
e << "However, this version of CMake no longer supports the OLD "
<< "behavior for these policies. "
<< "Please either update your CMakeLists.txt files to conform to "
<< "the new behavior or use an older version of CMake that still "
<< "supports the old behavior.";
mf->IssueMessage(cmake::FATAL_ERROR, e.str());
}
//----------------------------------------------------------------------------
static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy,
cmPolicies::PolicyStatus* defaultSetting)
@ -589,8 +614,8 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
// Make sure the project does not use any ancient policies.
if(!ancientPolicies.empty())
{
this->DiagnoseAncientPolicies(ancientPolicies,
majorVer, minorVer, patchVer, mf);
DiagnoseAncientPolicies(ancientPolicies,
majorVer, minorVer, patchVer, mf);
cmSystemTools::SetFatalErrorOccured();
return false;
}
@ -671,28 +696,3 @@ cmPolicies::GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id)
<< "Run cmake --help-policy " << pid << " for more information.";
return e.str();
}
//----------------------------------------------------------------------------
void
cmPolicies::DiagnoseAncientPolicies(std::vector<PolicyID> const& ancient,
unsigned int majorVer,
unsigned int minorVer,
unsigned int patchVer,
cmMakefile* mf)
{
std::ostringstream e;
e << "The project requests behavior compatible with CMake version \""
<< majorVer << "." << minorVer << "." << patchVer
<< "\", which requires the OLD behavior for some policies:\n";
for(std::vector<PolicyID>::const_iterator
i = ancient.begin(); i != ancient.end(); ++i)
{
e << " " << idToString(*i) << ": " << idToShortDescription(*i) << "\n";
}
e << "However, this version of CMake no longer supports the OLD "
<< "behavior for these policies. "
<< "Please either update your CMakeLists.txt files to conform to "
<< "the new behavior or use an older version of CMake that still "
<< "supports the old behavior.";
mf->IssueMessage(cmake::FATAL_ERROR, e.str());
}

View File

@ -285,10 +285,6 @@ public:
private:
// might have to make these internal for VS6 not sure yet
std::map<PolicyID,cmPolicy *> Policies;
void DiagnoseAncientPolicies(std::vector<PolicyID> const& ancient,
unsigned int majorVer, unsigned int minorVer,
unsigned int patchVer, cmMakefile* mf);
};
#endif