[Cmake-commits] CMake branch, next, updated. v3.0.0-3946-g4386bf4

Brad King brad.king at kitware.com
Wed Jun 25 13:15:20 EDT 2014


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  4386bf4a1bcdcd7ca462387b522ff5022e379877 (commit)
       via  24637979962012ae170f7848ad69e896f8d3f67c (commit)
       via  7812d2a912ca596d3db9d28a9291e83a55ffe75c (commit)
       via  f48d8bd6f6bee4a24a3c716fc744f8dcdff7b399 (commit)
       via  7b0834e9bbe614670552036b14c7556a3c76c9a9 (commit)
       via  b8651d970d06325b9ad5166295e3bbc25052a8fd (commit)
      from  9100f2ea73a03cd38a7faddecebac7d193fad3a3 (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=4386bf4a1bcdcd7ca462387b522ff5022e379877
commit 4386bf4a1bcdcd7ca462387b522ff5022e379877
Merge: 9100f2e 2463797
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jun 25 13:15:19 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jun 25 13:15:19 2014 -0400

    Merge topic 'refactor-link-internals' into next
    
    24637979 cmTarget: Refactor ComputeLinkImplementation
    7812d2a9 cmTarget: Pre-indent a block in ComputeLinkImplementation
    f48d8bd6 cmTarget: Shorten a long line in ComputeLinkImplementation
    7b0834e9 cmTarget: Refactor internal LinkImplementation map
    b8651d97 cmTarget: Remove unnecessary 'mutable' markup


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=24637979962012ae170f7848ad69e896f8d3f67c
commit 24637979962012ae170f7848ad69e896f8d3f67c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 19 13:48:28 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 25 10:33:36 2014 -0400

    cmTarget: Refactor ComputeLinkImplementation
    
    Use LinkImplementationPropertyEntries directly instead of asking
    GetProperty to construct a string for LINK_LIBRARIES.  This gives us
    access to the entry backtraces.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 910d951..aa0ed56 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6579,15 +6579,18 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
                                          cmTarget const* head) const
 {
   // Collect libraries directly linked in this configuration.
-  std::vector<std::string> llibs;
-  if(const char *prop = this->GetProperty("LINK_LIBRARIES"))
+  for (std::vector<cmValueWithOrigin>::const_iterator
+      le = this->Internal->LinkImplementationPropertyEntries.begin(),
+      end = this->Internal->LinkImplementationPropertyEntries.end();
+      le != end; ++le)
     {
-    cmGeneratorExpression ge;
-    const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
-
+    std::vector<std::string> llibs;
     cmGeneratorExpressionDAGChecker dagChecker(
                                         this->GetName(),
                                         "LINK_LIBRARIES", 0, 0);
+    cmGeneratorExpression ge(&le->Backtrace);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> const cge =
+      ge.Parse(le->Value);
     cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
                                         config,
                                         false,
@@ -6595,18 +6598,6 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
                                         &dagChecker),
                                       llibs);
 
-    std::set<std::string> const& seenProps = cge->GetSeenTargetProperties();
-    for (std::set<std::string>::const_iterator it = seenProps.begin();
-        it != seenProps.end(); ++it)
-      {
-      if (!this->GetProperty(*it))
-        {
-        this->LinkImplicitNullProperties.insert(*it);
-        }
-      }
-    cge->GetMaxLanguageStandard(this, this->MaxLanguageStandards);
-    }
-
     for(std::vector<std::string>::const_iterator li = llibs.begin();
         li != llibs.end(); ++li)
       {
@@ -6656,6 +6647,18 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
         cmLinkItem(name, this->FindTargetToLink(name)));
       }
 
+    std::set<std::string> const& seenProps = cge->GetSeenTargetProperties();
+    for (std::set<std::string>::const_iterator it = seenProps.begin();
+        it != seenProps.end(); ++it)
+      {
+      if (!this->GetProperty(*it))
+        {
+        this->LinkImplicitNullProperties.insert(*it);
+        }
+      }
+    cge->GetMaxLanguageStandard(this, this->MaxLanguageStandards);
+    }
+
   cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
   LinkLibraryVectorType const& oldllibs = this->GetOriginalLinkLibraries();
   for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7812d2a912ca596d3db9d28a9291e83a55ffe75c
commit 7812d2a912ca596d3db9d28a9291e83a55ffe75c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 19 13:45:15 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 25 10:33:36 2014 -0400

    cmTarget: Pre-indent a block in ComputeLinkImplementation
    
    Prepare to move it into another block without extra whitespace changes.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b418405..910d951 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6607,54 +6607,54 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
     cge->GetMaxLanguageStandard(this, this->MaxLanguageStandards);
     }
 
-  for(std::vector<std::string>::const_iterator li = llibs.begin();
-      li != llibs.end(); ++li)
-    {
-    // Skip entries that resolve to the target itself or are empty.
-    std::string name = this->CheckCMP0004(*li);
-    if(name == this->GetName() || name.empty())
+    for(std::vector<std::string>::const_iterator li = llibs.begin();
+        li != llibs.end(); ++li)
       {
-      if(name == this->GetName())
+      // Skip entries that resolve to the target itself or are empty.
+      std::string name = this->CheckCMP0004(*li);
+      if(name == this->GetName() || name.empty())
         {
-        bool noMessage = false;
-        cmake::MessageType messageType = cmake::FATAL_ERROR;
-        cmOStringStream e;
-        switch(this->GetPolicyStatusCMP0038())
+        if(name == this->GetName())
           {
-          case cmPolicies::WARN:
+          bool noMessage = false;
+          cmake::MessageType messageType = cmake::FATAL_ERROR;
+          cmOStringStream e;
+          switch(this->GetPolicyStatusCMP0038())
             {
-            e << (this->Makefile->GetPolicies()
-                  ->GetPolicyWarning(cmPolicies::CMP0038)) << "\n";
-            messageType = cmake::AUTHOR_WARNING;
+            case cmPolicies::WARN:
+              {
+              e << (this->Makefile->GetPolicies()
+                    ->GetPolicyWarning(cmPolicies::CMP0038)) << "\n";
+              messageType = cmake::AUTHOR_WARNING;
+              }
+              break;
+            case cmPolicies::OLD:
+              noMessage = true;
+            case cmPolicies::REQUIRED_IF_USED:
+            case cmPolicies::REQUIRED_ALWAYS:
+            case cmPolicies::NEW:
+              // Issue the fatal message.
+              break;
             }
-            break;
-          case cmPolicies::OLD:
-            noMessage = true;
-          case cmPolicies::REQUIRED_IF_USED:
-          case cmPolicies::REQUIRED_ALWAYS:
-          case cmPolicies::NEW:
-            // Issue the fatal message.
-            break;
-          }
 
-        if(!noMessage)
-          {
-          e << "Target \"" << this->GetName() << "\" links to itself.";
-          this->Makefile->GetCMakeInstance()->IssueMessage(
-            messageType, e.str(), this->GetBacktrace());
-          if (messageType == cmake::FATAL_ERROR)
+          if(!noMessage)
             {
-            return;
+            e << "Target \"" << this->GetName() << "\" links to itself.";
+            this->Makefile->GetCMakeInstance()->IssueMessage(
+              messageType, e.str(), this->GetBacktrace());
+            if (messageType == cmake::FATAL_ERROR)
+              {
+              return;
+              }
             }
           }
+        continue;
         }
-      continue;
-      }
 
-    // The entry is meant for this configuration.
-    impl.Libraries.push_back(
-      cmLinkItem(name, this->FindTargetToLink(name)));
-    }
+      // The entry is meant for this configuration.
+      impl.Libraries.push_back(
+        cmLinkItem(name, this->FindTargetToLink(name)));
+      }
 
   cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
   LinkLibraryVectorType const& oldllibs = this->GetOriginalLinkLibraries();

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f48d8bd6f6bee4a24a3c716fc744f8dcdff7b399
commit f48d8bd6f6bee4a24a3c716fc744f8dcdff7b399
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 19 13:44:24 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 25 10:33:36 2014 -0400

    cmTarget: Shorten a long line in ComputeLinkImplementation
    
    Prepare to change its indentation without exceeding line length limit.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 5bb15f5..b418405 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6640,9 +6640,8 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
         if(!noMessage)
           {
           e << "Target \"" << this->GetName() << "\" links to itself.";
-          this->Makefile->GetCMakeInstance()->IssueMessage(messageType,
-                                                        e.str(),
-                                                        this->GetBacktrace());
+          this->Makefile->GetCMakeInstance()->IssueMessage(
+            messageType, e.str(), this->GetBacktrace());
           if (messageType == cmake::FATAL_ERROR)
             {
             return;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b0834e9bbe614670552036b14c7556a3c76c9a9
commit 7b0834e9bbe614670552036b14c7556a3c76c9a9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 19 10:45:08 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 25 10:33:36 2014 -0400

    cmTarget: Refactor internal LinkImplementation map
    
    If ComputeLinkImplementationLanguages were ever to cause
    GetLinkImplementationLibraries to be invoked then a LinkImplMap entry
    may appear in the middle of computing it in GetLinkInformation.  Instead
    create the map entry up front and store in it boolean values indicating
    which pieces of the LinkImplementation structure have been populated.
    This approach leads to shorter code that is easier to follow too.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c8b1690..5bb15f5 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -144,8 +144,15 @@ public:
   CompileInfoMapType CompileInfoMap;
 
   // Cache link implementation computation from each configuration.
+  struct OptionalLinkImplementation: public cmTarget::LinkImplementation
+  {
+    OptionalLinkImplementation():
+      LibrariesDone(false), LanguagesDone(false) {}
+    bool LibrariesDone;
+    bool LanguagesDone;
+  };
   typedef std::map<TargetConfigPair,
-                   cmTarget::LinkImplementation> LinkImplMapType;
+                   OptionalLinkImplementation> LinkImplMapType;
   LinkImplMapType LinkImplMap;
 
   typedef std::map<std::string, cmTarget::LinkClosure> LinkClosureMapType;
@@ -6519,28 +6526,21 @@ cmTarget::GetLinkImplementation(const std::string& config) const
     return 0;
     }
 
-  // Lookup any existing link implementation for this configuration.
+  // Populate the link implementation for this configuration.
   TargetConfigPair key(this, cmSystemTools::UpperCase(config));
-
-  cmTargetInternals::LinkImplMapType::iterator
-    i = this->Internal->LinkImplMap.find(key);
-  if(i == this->Internal->LinkImplMap.end())
+  cmTargetInternals::OptionalLinkImplementation&
+    impl = this->Internal->LinkImplMap[key];
+  if(!impl.LibrariesDone)
     {
-    // Compute the link implementation for this configuration.
-    LinkImplementation impl;
+    impl.LibrariesDone = true;
     this->ComputeLinkImplementation(config, impl, this);
-    this->ComputeLinkImplementationLanguages(config, impl, this);
-
-    // Store the information for this configuration.
-    cmTargetInternals::LinkImplMapType::value_type entry(key, impl);
-    i = this->Internal->LinkImplMap.insert(entry).first;
     }
-  else if (i->second.Languages.empty())
+  if(!impl.LanguagesDone)
     {
-    this->ComputeLinkImplementationLanguages(config, i->second, this);
+    impl.LanguagesDone = true;
+    this->ComputeLinkImplementationLanguages(config, impl, this);
     }
-
-  return &i->second;
+  return &impl;
 }
 
 //----------------------------------------------------------------------------
@@ -6561,23 +6561,16 @@ cmTarget::GetLinkImplementationLibrariesInternal(const std::string& config,
     return 0;
     }
 
-  // Lookup any existing link implementation for this configuration.
+  // Populate the link implementation libraries for this configuration.
   TargetConfigPair key(head, cmSystemTools::UpperCase(config));
-
-  cmTargetInternals::LinkImplMapType::iterator
-    i = this->Internal->LinkImplMap.find(key);
-  if(i == this->Internal->LinkImplMap.end())
+  cmTargetInternals::OptionalLinkImplementation&
+    impl = this->Internal->LinkImplMap[key];
+  if(!impl.LibrariesDone)
     {
-    // Compute the link implementation for this configuration.
-    LinkImplementation impl;
-    this->ComputeLinkImplementation(config, impl, head);
-
-    // Store the information for this configuration.
-    cmTargetInternals::LinkImplMapType::value_type entry(key, impl);
-    i = this->Internal->LinkImplMap.insert(entry).first;
+    impl.LibrariesDone = true;
+    this->ComputeLinkImplementation(config, impl, this);
     }
-
-  return &i->second;
+  return &impl;
 }
 
 //----------------------------------------------------------------------------

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8651d970d06325b9ad5166295e3bbc25052a8fd
commit b8651d970d06325b9ad5166295e3bbc25052a8fd
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 19 13:36:09 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 25 10:33:36 2014 -0400

    cmTarget: Remove unnecessary 'mutable' markup
    
    Members of the cmTargetInternals structure do not need to be made
    'mutable' even to cache data because there is no reason for the
    internal methods to be 'const'.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index cb52e15..c8b1690 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -174,25 +174,25 @@ public:
   std::vector<TargetPropertyEntry*> SourceEntries;
   std::vector<cmValueWithOrigin> LinkImplementationPropertyEntries;
 
-  mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
-                                CachedLinkInterfaceIncludeDirectoriesEntries;
-  mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
-                                CachedLinkInterfaceCompileOptionsEntries;
-  mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
-                                CachedLinkInterfaceCompileDefinitionsEntries;
-  mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
-                                CachedLinkInterfaceSourcesEntries;
-  mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
-                                CachedLinkInterfaceCompileFeaturesEntries;
-  mutable std::map<std::string, std::vector<cmTarget const*> >
-                                CachedLinkImplementationClosure;
-
-  mutable std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
-  mutable std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
-  mutable std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
-  mutable std::map<std::string, bool> CacheLinkInterfaceSourcesDone;
-  mutable std::map<std::string, bool> CacheLinkInterfaceCompileFeaturesDone;
-  mutable std::map<std::string, bool> CacheLinkImplementationClosureDone;
+  std::map<std::string, std::vector<TargetPropertyEntry*> >
+                        CachedLinkInterfaceIncludeDirectoriesEntries;
+  std::map<std::string, std::vector<TargetPropertyEntry*> >
+                        CachedLinkInterfaceCompileOptionsEntries;
+  std::map<std::string, std::vector<TargetPropertyEntry*> >
+                        CachedLinkInterfaceCompileDefinitionsEntries;
+  std::map<std::string, std::vector<TargetPropertyEntry*> >
+                        CachedLinkInterfaceSourcesEntries;
+  std::map<std::string, std::vector<TargetPropertyEntry*> >
+                        CachedLinkInterfaceCompileFeaturesEntries;
+  std::map<std::string, std::vector<cmTarget const*> >
+                        CachedLinkImplementationClosure;
+
+  std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
+  std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
+  std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
+  std::map<std::string, bool> CacheLinkInterfaceSourcesDone;
+  std::map<std::string, bool> CacheLinkInterfaceCompileFeaturesDone;
+  std::map<std::string, bool> CacheLinkImplementationClosureDone;
 };
 
 //----------------------------------------------------------------------------

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

Summary of changes:
 Source/cmTarget.cxx |  201 +++++++++++++++++++++++++--------------------------
 1 file changed, 98 insertions(+), 103 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list