summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-16 16:21:29 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-16 16:21:29 (GMT)
commit1d00ed7cf7ffd5c51dfcf77075589ab0e30d29a3 (patch)
treefebf97882d269d90614e1bf098a0eca9769fa3b6 /Source/cmPolicies.cxx
parent0df559832bdc629df333b57c798d42e77716a94b (diff)
downloadCMake-1d00ed7cf7ffd5c51dfcf77075589ab0e30d29a3.zip
CMake-1d00ed7cf7ffd5c51dfcf77075589ab0e30d29a3.tar.gz
CMake-1d00ed7cf7ffd5c51dfcf77075589ab0e30d29a3.tar.bz2
cmPolicies: Drop unnecessary check from ApplyPolicyVersion
This internal API is never called with `version_min` empty.
Diffstat (limited to 'Source/cmPolicies.cxx')
-rw-r--r--Source/cmPolicies.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 7e3bd78..adb6e78 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -156,22 +156,16 @@ static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy,
bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf,
std::string const& version_min)
{
- std::string ver = "2.4.0";
-
- if (!version_min.empty()) {
- ver = version_min;
- }
-
unsigned int majorVer = 2;
unsigned int minorVer = 0;
unsigned int patchVer = 0;
unsigned int tweakVer = 0;
// parse the string
- if (sscanf(ver.c_str(), "%u.%u.%u.%u", &majorVer, &minorVer, &patchVer,
- &tweakVer) < 2) {
+ if (sscanf(version_min.c_str(), "%u.%u.%u.%u", &majorVer, &minorVer,
+ &patchVer, &tweakVer) < 2) {
std::ostringstream e;
- e << "Invalid policy version value \"" << ver << "\". "
+ e << "Invalid policy version value \"" << version_min << "\". "
<< "A numeric major.minor[.patch[.tweak]] must be given.";
mf->IssueMessage(cmake::FATAL_ERROR, e.str());
return false;