[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2270-g0256c0a

Stephen Kelly steveire at gmail.com
Fri Feb 22 07:05:00 EST 2013


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  0256c0ae92e71295dedb0317a320e79d0a33a601 (commit)
       via  92411af173c20503bdbacdd1dee4ce97034838cb (commit)
       via  f7474f3a0195c105b9b981bc4d558edcc1dede57 (commit)
      from  53b2797e114a3773a18051149b4a83da2d035902 (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=0256c0ae92e71295dedb0317a320e79d0a33a601
commit 0256c0ae92e71295dedb0317a320e79d0a33a601
Merge: 53b2797 92411af
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Feb 22 07:04:56 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Feb 22 07:04:56 2013 -0500

    Merge topic 'memoize-link-iface-includes-defines' into next
    
    92411af Memoize includes and defines from interface libraries.
    f7474f3 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92411af173c20503bdbacdd1dee4ce97034838cb
commit 92411af173c20503bdbacdd1dee4ce97034838cb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Feb 22 13:03:35 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Feb 22 13:03:35 2013 +0100

    Memoize includes and defines from interface libraries.
    
    This is similar in spirit to commit e48d8420 (Cache context-independent
    includes on evaluation., 2013-02-03), but it is needed since commit
    a1c4905f (Use the link information as a source of compile definitions
    and includes., 2013-02-12), which changed how includes and defines
    are determined. As they are now determined through the link interface,
    we need to cache the result of evaluating them through that.
    
    In the case of the includes, the result was already being cached
    and then immediately disposed. Store the result as a member variable
    instead to make use of the caching.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 003f3d8..5788094 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -138,6 +138,13 @@ public:
   };
   std::vector<IncludeDirectoriesEntry*> IncludeDirectoriesEntries;
   std::vector<cmValueWithOrigin> LinkInterfaceIncludeDirectoriesEntries;
+
+  std::vector<cmTargetInternals::IncludeDirectoriesEntry*>
+                                CachedLinkInterfaceIncludeDirectoriesEntries;
+  std::map<std::string, std::string> CachedLinkInterfaceCompileDefinitions;
+
+  std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
+  std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
 };
 
 //----------------------------------------------------------------------------
@@ -2870,41 +2877,53 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
                             config,
                             debugIncludes);
 
-  std::vector<cmTargetInternals::IncludeDirectoriesEntry*>
-                                      linkInterfaceIncludeDirectoriesEntries;
-
-  for (std::vector<cmValueWithOrigin>::const_iterator
-      it = this->Internal->LinkInterfaceIncludeDirectoriesEntries.begin(),
-      end = this->Internal->LinkInterfaceIncludeDirectoriesEntries.end();
-      it != end; ++it)
+  std::string configString = config ? config : "";
+  if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString])
     {
-    {
-    cmGeneratorExpression ge(lfbt);
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(it->Value);
-    std::string result = cge->Evaluate(this->Makefile, config,
-                                       false, this, 0, 0);
-    if (!this->Makefile->FindTargetToUse(result.c_str()))
+    for (std::vector<cmValueWithOrigin>::const_iterator
+        it = this->Internal->LinkInterfaceIncludeDirectoriesEntries.begin(),
+        end = this->Internal->LinkInterfaceIncludeDirectoriesEntries.end();
+        it != end; ++it)
       {
-      continue;
+      {
+      cmGeneratorExpression ge(lfbt);
+      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+                                                        ge.Parse(it->Value);
+      std::string result = cge->Evaluate(this->Makefile, config,
+                                        false, this, 0, 0);
+      if (!this->Makefile->FindTargetToUse(result.c_str()))
+        {
+        continue;
+        }
       }
-    }
-    cmGeneratorExpression ge(it->Backtrace);
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
-        "$<TARGET_PROPERTY:" + it->Value + ",INTERFACE_INCLUDE_DIRECTORIES>");
+      cmGeneratorExpression ge(it->Backtrace);
+      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
+          "$<TARGET_PROPERTY:" +
+                              it->Value + ",INTERFACE_INCLUDE_DIRECTORIES>");
 
-    linkInterfaceIncludeDirectoriesEntries.push_back(
+      this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries.push_back(
                         new cmTargetInternals::IncludeDirectoriesEntry(cge));
+      }
     }
 
   processIncludeDirectories(this,
-                            linkInterfaceIncludeDirectoriesEntries,
+              this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries,
                             includes,
                             uniqueIncludes,
                             &dagChecker,
                             config,
                             debugIncludes);
 
-  deleteAndClear(linkInterfaceIncludeDirectoriesEntries);
+  if (!this->Makefile->IsGeneratingBuildSystem())
+    {
+    deleteAndClear(
+              this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries);
+    }
+  else
+    {
+    this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString]
+                                                                      = true;
+    }
 
   return includes;
 }
@@ -2957,16 +2976,34 @@ std::string cmTarget::GetCompileDefinitions(const char *config)
       }
     }
 
-  cmGeneratorExpression ge2(lfbt);
-  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge2 = ge2.Parse(depString);
-  std::string depResult = cge2->Evaluate(this->Makefile,
-                      config,
-                      false,
-                      this,
-                      &dagChecker);
-  if (!depResult.empty())
+  std::string configString = config ? config : "";
+  if (!this->Internal->CacheLinkInterfaceCompileDefinitionsDone[configString])
+    {
+    cmGeneratorExpression ge2(lfbt);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge2 =
+                                                        ge2.Parse(depString);
+    this->Internal->CachedLinkInterfaceCompileDefinitions[configString] =
+                                                cge2->Evaluate(this->Makefile,
+                                                               config,
+                                                               false,
+                                                               this,
+                                                               &dagChecker);
+    }
+  if (!this->Internal->CachedLinkInterfaceCompileDefinitions[configString]
+                                                                    .empty())
+    {
+    result += (result.empty() ? "" : ";")
+        + this->Internal->CachedLinkInterfaceCompileDefinitions[configString];
+    }
+
+  if (!this->Makefile->IsGeneratingBuildSystem())
+    {
+    this->Internal->CachedLinkInterfaceCompileDefinitions[configString] = "";
+    }
+  else
     {
-    result += (result.empty() ? "" : ";") + depResult;
+    this->Internal->CacheLinkInterfaceCompileDefinitionsDone[configString]
+                                                                      = true;
     }
 
   return result;

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

Summary of changes:
 Source/CMakeVersion.cmake |    2 +-
 Source/cmTarget.cxx       |   97 +++++++++++++++++++++++++++++++--------------
 2 files changed, 68 insertions(+), 31 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list