[Cmake-commits] CMake branch, next, updated. v3.3.0-rc4-1292-g29ca03c

Stephen Kelly steveire at gmail.com
Thu Jul 23 01:40:05 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  29ca03c178146aa4a7c9701ad4a3ed569ad2946c (commit)
       via  aff42eb45d8dca37fc1caa5ee7172482ab3ebcd7 (commit)
       via  7220168914ae1a2ce72d11f04f614bf67944c94e (commit)
       via  ccba156ffbd61a32a6d52276af2cccea5e908b3b (commit)
       via  227703ee1f118083d3a0a2890a4d83f99297aba0 (commit)
       via  f626b083bb424ac1cedf6c096ffde613ccf0873a (commit)
       via  63eb9f6a325d36569c68c59af4cc1ba69169dc76 (commit)
       via  c36bd361f7115e781fa73e1ade55dd4ec0c44e68 (commit)
      from  f1cac2bb6f269687a6140bece5528b1fdb128091 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29ca03c178146aa4a7c9701ad4a3ed569ad2946c
commit 29ca03c178146aa4a7c9701ad4a3ed569ad2946c
Merge: f1cac2b aff42eb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jul 23 01:40:04 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jul 23 01:40:04 2015 -0400

    Merge topic 'policy-refactor' into next
    
    aff42eb4 cmMakefile: Remove CMP0001 handling to callers.
    72201689 cmMakefile: Simplify computation of ancient policy status.
    ccba156f cmMakefile: Remove redundant condition from policy status computation.
    227703ee cmMakefile: Inline internal policy status method.
    f626b083 cmPolicies: Enable RVO for internal method.
    63eb9f6a cmPolicies: Store only state that users can set.
    c36bd361 cmMakefile: Convert recursion to loop.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aff42eb45d8dca37fc1caa5ee7172482ab3ebcd7
commit aff42eb45d8dca37fc1caa5ee7172482ab3ebcd7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 6 02:10:25 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jul 22 21:34:36 2015 +0200

    cmMakefile: Remove CMP0001 handling to callers.

diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx
index 3c878bf..3ef6d35 100644
--- a/Source/cmCMakePolicyCommand.cxx
+++ b/Source/cmCMakePolicyCommand.cxx
@@ -93,6 +93,22 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector<std::string> const& args)
     this->SetError("SET failed to set policy.");
     return false;
     }
+  if(args[1] == "CMP0001" &&
+     (status == cmPolicies::WARN || status == cmPolicies::OLD))
+    {
+    if(!(this->Makefile->GetState()
+         ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
+      {
+      // Set it to 2.4 because that is the last version where the
+      // variable had meaning.
+      this->Makefile->AddCacheDefinition
+        ("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
+         "For backwards compatibility, what version of CMake "
+         "commands and "
+         "syntax should this version of CMake try to support.",
+         cmState::STRING);
+      }
+    }
   return true;
 }
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0c3eb51..f0a6199 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4822,25 +4822,6 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
     previous_was_weak = psi->Weak;
     }
 
-  // Special hook for presenting compatibility variable as soon as
-  // the user requests it.
-  if(id == cmPolicies::CMP0001 &&
-     (status == cmPolicies::WARN || status == cmPolicies::OLD))
-    {
-    if(!(this->GetState()
-         ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
-      {
-      // Set it to 2.4 because that is the last version where the
-      // variable had meaning.
-      this->AddCacheDefinition
-        ("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
-         "For backwards compatibility, what version of CMake "
-         "commands and "
-         "syntax should this version of CMake try to support.",
-         cmState::STRING);
-      }
-    }
-
   return true;
 }
 
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 2a5ae1c..3eb19bb 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -255,6 +255,22 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
           {
           return false;
           }
+        if(pid == cmPolicies::CMP0001 &&
+           (status == cmPolicies::WARN || status == cmPolicies::OLD))
+          {
+          if(!(mf->GetState()
+               ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
+            {
+            // Set it to 2.4 because that is the last version where the
+            // variable had meaning.
+            mf->AddCacheDefinition
+              ("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
+               "For backwards compatibility, what version of CMake "
+               "commands and "
+               "syntax should this version of CMake try to support.",
+               cmState::STRING);
+            }
+          }
         }
       }
     else

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7220168914ae1a2ce72d11f04f614bf67944c94e
commit 7220168914ae1a2ce72d11f04f614bf67944c94e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 6 02:04:12 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jul 22 21:34:35 2015 +0200

    cmMakefile: Simplify computation of ancient policy status.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 57e6c60..0c3eb51 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4743,6 +4743,13 @@ cmPolicies::PolicyStatus
 cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
 {
   cmPolicies::PolicyStatus status = cmPolicies::GetPolicyStatus(id);
+
+  if(status == cmPolicies::REQUIRED_ALWAYS ||
+     status == cmPolicies::REQUIRED_IF_USED)
+    {
+    return status;
+    }
+
   cmLocalGenerator* lg = this->LocalGenerator;
   while(lg)
     {
@@ -4758,20 +4765,6 @@ cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
       }
     lg = lg->GetParent();
     }
-
-  // If the policy is required to be set to NEW but is not, ignore the
-  // current setting and tell the caller.
-  if(status != cmPolicies::NEW)
-    {
-    cmPolicies::PolicyStatus def = cmPolicies::GetPolicyStatus(id);
-    if(def == cmPolicies::REQUIRED_ALWAYS ||
-       def == cmPolicies::REQUIRED_IF_USED)
-      {
-      return def;
-      }
-    }
-
-  // The current setting is okay.
   return status;
 }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ccba156ffbd61a32a6d52276af2cccea5e908b3b
commit ccba156ffbd61a32a6d52276af2cccea5e908b3b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 6 02:02:02 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jul 22 21:34:35 2015 +0200

    cmMakefile: Remove redundant condition from policy status computation.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index aa77d5c..57e6c60 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4763,11 +4763,6 @@ cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
   // current setting and tell the caller.
   if(status != cmPolicies::NEW)
     {
-    if(status == cmPolicies::REQUIRED_ALWAYS ||
-       status == cmPolicies::REQUIRED_IF_USED)
-      {
-      return status;
-      }
     cmPolicies::PolicyStatus def = cmPolicies::GetPolicyStatus(id);
     if(def == cmPolicies::REQUIRED_ALWAYS ||
        def == cmPolicies::REQUIRED_IF_USED)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=227703ee1f118083d3a0a2890a4d83f99297aba0
commit 227703ee1f118083d3a0a2890a4d83f99297aba0
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 6 02:00:32 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jul 22 21:34:34 2015 +0200

    cmMakefile: Inline internal policy status method.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f614d40..aa77d5c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4742,34 +4742,6 @@ const char* cmMakefile::GetDefineFlagsCMP0059() const
 cmPolicies::PolicyStatus
 cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
 {
-  // Get the current setting of the policy.
-  cmPolicies::PolicyStatus cur = this->GetPolicyStatusInternal(id);
-
-  // If the policy is required to be set to NEW but is not, ignore the
-  // current setting and tell the caller.
-  if(cur != cmPolicies::NEW)
-    {
-    if(cur == cmPolicies::REQUIRED_ALWAYS ||
-       cur == cmPolicies::REQUIRED_IF_USED)
-      {
-      return cur;
-      }
-    cmPolicies::PolicyStatus def = cmPolicies::GetPolicyStatus(id);
-    if(def == cmPolicies::REQUIRED_ALWAYS ||
-       def == cmPolicies::REQUIRED_IF_USED)
-      {
-      return def;
-      }
-    }
-
-  // The current setting is okay.
-  return cur;
-}
-
-//----------------------------------------------------------------------------
-cmPolicies::PolicyStatus
-cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
-{
   cmPolicies::PolicyStatus status = cmPolicies::GetPolicyStatus(id);
   cmLocalGenerator* lg = this->LocalGenerator;
   while(lg)
@@ -4787,7 +4759,24 @@ cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
     lg = lg->GetParent();
     }
 
-  // The policy is not set.  Use the default for this CMake version.
+  // If the policy is required to be set to NEW but is not, ignore the
+  // current setting and tell the caller.
+  if(status != cmPolicies::NEW)
+    {
+    if(status == cmPolicies::REQUIRED_ALWAYS ||
+       status == cmPolicies::REQUIRED_IF_USED)
+      {
+      return status;
+      }
+    cmPolicies::PolicyStatus def = cmPolicies::GetPolicyStatus(id);
+    if(def == cmPolicies::REQUIRED_ALWAYS ||
+       def == cmPolicies::REQUIRED_IF_USED)
+      {
+      return def;
+      }
+    }
+
+  // The current setting is okay.
   return status;
 }
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 2fc4d78..6dbea89 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -938,8 +938,6 @@ private:
   typedef std::vector<PolicyStackEntry> PolicyStackType;
   PolicyStackType PolicyStack;
   std::vector<PolicyStackType::size_type> PolicyBarriers;
-  cmPolicies::PolicyStatus
-  GetPolicyStatusInternal(cmPolicies::PolicyID id) const;
 
   // CMP0053 == old
   cmake::MessageType ExpandVariablesInStringOld(

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f626b083bb424ac1cedf6c096ffde613ccf0873a
commit f626b083bb424ac1cedf6c096ffde613ccf0873a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jul 6 01:55:29 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jul 22 21:34:33 2015 +0200

    cmPolicies: Enable RVO for internal method.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 1a6601b..f614d40 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4770,6 +4770,7 @@ cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
 cmPolicies::PolicyStatus
 cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
 {
+  cmPolicies::PolicyStatus status = cmPolicies::GetPolicyStatus(id);
   cmLocalGenerator* lg = this->LocalGenerator;
   while(lg)
     {
@@ -4779,14 +4780,15 @@ cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
       {
       if(psi->IsDefined(id))
         {
-        return psi->Get(id);
+        status = psi->Get(id);
+        return status;
         }
       }
     lg = lg->GetParent();
     }
 
   // The policy is not set.  Use the default for this CMake version.
-  return cmPolicies::GetPolicyStatus(id);
+  return status;
 }
 
 //----------------------------------------------------------------------------

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=63eb9f6a325d36569c68c59af4cc1ba69169dc76
commit 63eb9f6a325d36569c68c59af4cc1ba69169dc76
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jun 22 03:18:55 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jul 22 21:33:07 2015 +0200

    cmPolicies: Store only state that users can set.
    
    cmPolicies::PolicyMap does not need to store the REQUIRED_ALWAYS or
    REQUIRED_IF_USED states as they are statically determined.

diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 5026893..2a5ae1c 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -356,14 +356,6 @@ cmPolicies::PolicyMap::Get(cmPolicies::PolicyID id) const
     {
     status = cmPolicies::NEW;
     }
-  else if (this->Status[(POLICY_STATUS_COUNT * id) + REQUIRED_ALWAYS])
-    {
-    status = cmPolicies::REQUIRED_ALWAYS;
-    }
-  else if (this->Status[(POLICY_STATUS_COUNT * id) + REQUIRED_IF_USED])
-    {
-    status = cmPolicies::REQUIRED_IF_USED;
-    }
   return status;
 }
 
@@ -373,19 +365,13 @@ void cmPolicies::PolicyMap::Set(cmPolicies::PolicyID id,
   this->Status[(POLICY_STATUS_COUNT * id) + OLD] = (status == OLD);
   this->Status[(POLICY_STATUS_COUNT * id) + WARN] = (status == WARN);
   this->Status[(POLICY_STATUS_COUNT * id) + NEW] = (status == NEW);
-  this->Status[(POLICY_STATUS_COUNT * id) + REQUIRED_ALWAYS] =
-      (status == REQUIRED_ALWAYS);
-  this->Status[(POLICY_STATUS_COUNT * id) + REQUIRED_IF_USED] =
-      (status == REQUIRED_IF_USED);
 }
 
 bool cmPolicies::PolicyMap::IsDefined(cmPolicies::PolicyID id) const
 {
   return this->Status[(POLICY_STATUS_COUNT * id) + OLD]
       || this->Status[(POLICY_STATUS_COUNT * id) + WARN]
-      || this->Status[(POLICY_STATUS_COUNT * id) + NEW]
-      || this->Status[(POLICY_STATUS_COUNT * id) + REQUIRED_ALWAYS]
-      || this->Status[(POLICY_STATUS_COUNT * id) + REQUIRED_IF_USED];
+      || this->Status[(POLICY_STATUS_COUNT * id) + NEW];
 }
 
 bool cmPolicies::PolicyMap::IsEmpty() const
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 8a3c27d..a5aba58 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -244,7 +244,6 @@ public:
     REQUIRED_IF_USED,
     REQUIRED_ALWAYS ///< Issue an error unless user sets policy status to NEW.
   };
-#define POLICY_STATUS_COUNT 5
 
   /// Policy identifiers
   enum PolicyID
@@ -288,6 +287,7 @@ public:
     bool IsEmpty() const;
 
   private:
+#define POLICY_STATUS_COUNT 3
     std::bitset<cmPolicies::CMPCOUNT * POLICY_STATUS_COUNT> Status;
   };
 };

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c36bd361f7115e781fa73e1ade55dd4ec0c44e68
commit c36bd361f7115e781fa73e1ade55dd4ec0c44e68
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jun 4 23:38:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Jul 22 21:29:14 2015 +0200

    cmMakefile: Convert recursion to loop.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ae69b24..1a6601b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4770,21 +4770,19 @@ cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
 cmPolicies::PolicyStatus
 cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) const
 {
-  // Is the policy set in our stack?
-  for(PolicyStackType::const_reverse_iterator psi = this->PolicyStack.rbegin();
-      psi != this->PolicyStack.rend(); ++psi)
+  cmLocalGenerator* lg = this->LocalGenerator;
+  while(lg)
     {
-    if(psi->IsDefined(id))
+    cmMakefile* mf = lg->GetMakefile();
+    for(PolicyStackType::const_reverse_iterator psi =
+        mf->PolicyStack.rbegin(); psi != mf->PolicyStack.rend(); ++psi)
       {
-      return psi->Get(id);
+      if(psi->IsDefined(id))
+        {
+        return psi->Get(id);
+        }
       }
-    }
-
-  // If we have a parent directory, recurse up to it.
-  if(this->LocalGenerator->GetParent())
-    {
-    cmMakefile* parent = this->LocalGenerator->GetParent()->GetMakefile();
-    return parent->GetPolicyStatusInternal(id);
+    lg = lg->GetParent();
     }
 
   // The policy is not set.  Use the default for this CMake version.

-----------------------------------------------------------------------

Summary of changes:
 Source/cmCMakePolicyCommand.cxx |   16 +++++++++
 Source/cmMakefile.cxx           |   74 +++++++++------------------------------
 Source/cmMakefile.h             |    2 --
 Source/cmPolicies.cxx           |   32 +++++++++--------
 Source/cmPolicies.h             |    2 +-
 5 files changed, 50 insertions(+), 76 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list