From e3a8c0291e6ae364365bfe48f12c6a5f4ec0e76f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 3 May 2015 10:10:35 +0200 Subject: cmPolicies: Make private method file-static. --- Source/cmPolicies.cxx | 54 +++++++++++++++++++++++++-------------------------- Source/cmPolicies.h | 4 ---- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index c1a2d2f..acb591b 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -467,6 +467,31 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, } //---------------------------------------------------------------------------- +static void DiagnoseAncientPolicies( + std::vector 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::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 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::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()); -} diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index df04fdf..2b96939 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -285,10 +285,6 @@ public: private: // might have to make these internal for VS6 not sure yet std::map Policies; - - void DiagnoseAncientPolicies(std::vector const& ancient, - unsigned int majorVer, unsigned int minorVer, - unsigned int patchVer, cmMakefile* mf); }; #endif -- cgit v0.12