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, master has been updated
       via  1e148aba7078359e2e5b4d7080a6e1cb6592d94a (commit)
       via  9b4d31dc771f630961d903df318f1539ddd955d1 (commit)
      from  1e2911b8cd512663ef35bf05de0b5f8156abc171 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e148aba7078359e2e5b4d7080a6e1cb6592d94a
commit 1e148aba7078359e2e5b4d7080a6e1cb6592d94a
Merge: 1e2911b 9b4d31d
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Dec 14 13:08:00 2017 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Thu Dec 14 08:08:05 2017 -0500

    Merge topic 'cmGraphVizWriter_Interface_Dependers'
    
    9b4d31dc cmGraphVizWriter: Updated to create and follow dependers for 
interface targets
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !1581


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b4d31dc771f630961d903df318f1539ddd955d1
commit 9b4d31dc771f630961d903df318f1539ddd955d1
Author:     Joel T. Frederico <joelfreder...@gmail.com>
AuthorDate: Fri Dec 8 21:27:24 2017 -0800
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Dec 14 08:03:02 2017 -0500

    cmGraphVizWriter: Updated to create and follow dependers for interface 
targets
    
    Generating graphs of dependencies now uses interface targets, but graphs
    of dependers did not include interface targets.

diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index dd2993d..e684f5e 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -29,6 +29,22 @@ enum LinkLibraryScopeType
 const char* const GRAPHVIZ_PRIVATE_EDEGE_STYLE = "dashed";
 const char* const GRAPHVIZ_INTERFACE_EDEGE_STYLE = "dotted";
 
+std::string getLinkLibraryStyle(const LinkLibraryScopeType& type)
+{
+  std::string style;
+  switch (type) {
+    case LLT_SCOPE_PRIVATE:
+      style = "[style = " + std::string(GRAPHVIZ_PRIVATE_EDEGE_STYLE) + "]";
+      break;
+    case LLT_SCOPE_INTERFACE:
+      style = "[style = " + std::string(GRAPHVIZ_INTERFACE_EDEGE_STYLE) + "]";
+      break;
+    default:
+      break;
+  }
+  return style;
+}
+
 const char* getShapeForTarget(const cmGeneratorTarget* target)
 {
   if (!target) {
@@ -132,6 +148,7 @@ cmGraphVizWriter::cmGraphVizWriter(
   , GenerateForStaticLibs(true)
   , GenerateForSharedLibs(true)
   , GenerateForModuleLibs(true)
+  , GenerateForInterface(true)
   , GenerateForExternals(true)
   , GeneratePerTarget(true)
   , GenerateDependers(true)
@@ -192,6 +209,7 @@ void cmGraphVizWriter::ReadSettings(const char* 
settingsFileName,
   __set_bool_if_set(this->GenerateForStaticLibs, "GRAPHVIZ_STATIC_LIBS");
   __set_bool_if_set(this->GenerateForSharedLibs, "GRAPHVIZ_SHARED_LIBS");
   __set_bool_if_set(this->GenerateForModuleLibs, "GRAPHVIZ_MODULE_LIBS");
+  __set_bool_if_set(this->GenerateForInterface, "GRAPHVIZ_INTERFACE");
   __set_bool_if_set(this->GenerateForExternals, "GRAPHVIZ_EXTERNAL_LIBS");
   __set_bool_if_set(this->GeneratePerTarget, "GRAPHVIZ_GENERATE_PER_TARGET");
   __set_bool_if_set(this->GenerateDependers, "GRAPHVIZ_GENERATE_DEPENDERS");
@@ -379,16 +397,7 @@ void cmGraphVizWriter::WriteConnections(
 
       str << "    \"" << myNodeName << "\" -> \"" << libNameIt->second << "\"";
 
-      switch (llit.second) {
-        case LLT_SCOPE_PRIVATE:
-          str << "[style = " << GRAPHVIZ_PRIVATE_EDEGE_STYLE << "]";
-          break;
-        case LLT_SCOPE_INTERFACE:
-          str << "[style = " << GRAPHVIZ_INTERFACE_EDEGE_STYLE << "]";
-          break;
-        default:
-          break;
-      }
+      str << getLinkLibraryStyle(llit.second);
 
       str << " // " << targetName << " -> " << libName << std::endl;
       this->WriteConnections(libName, insertedNodes, insertedConnections, str);
@@ -429,12 +438,11 @@ void cmGraphVizWriter::WriteDependerConnections(
 
     // Now we have a target, check whether it links against targetName.
     // If so, draw a connection, and then continue with dependers on that one.
-    const cmTarget::LinkLibraryVectorType* ll =
-      &(tptr.second->Target->GetOriginalLinkLibraries());
+    std::map<std::string, LinkLibraryScopeType> ll =
+      getScopedLinkLibrariesFromTarget(tptr.second->Target);
 
-    for (auto const& llit : *ll) {
-      std::string libName = llit.first;
-      if (libName == targetName) {
+    for (auto const& llit : ll) {
+      if (llit.first == targetName) {
         // So this target links against targetName.
         std::map<std::string, std::string>::const_iterator dependerNodeNameIt =
           this->TargetNamesNodes.find(tptr.first);
@@ -452,6 +460,7 @@ void cmGraphVizWriter::WriteDependerConnections(
             str << "    \"" << dependerNodeNameIt->second << "\" -> \""
                 << myNodeName << "\"";
             str << " // " << targetName << " -> " << tptr.first << std::endl;
+            str << getLinkLibraryStyle(llit.second);
             this->WriteDependerConnections(tptr.first, insertedNodes,
                                            insertedConnections, str);
           }
@@ -572,6 +581,8 @@ bool cmGraphVizWriter::GenerateForTargetType(
       return this->GenerateForSharedLibs;
     case cmStateEnums::MODULE_LIBRARY:
       return this->GenerateForModuleLibs;
+    case cmStateEnums::INTERFACE_LIBRARY:
+      return this->GenerateForInterface;
     default:
       break;
   }
diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h
index 824999b..ac20da9 100644
--- a/Source/cmGraphVizWriter.h
+++ b/Source/cmGraphVizWriter.h
@@ -79,6 +79,7 @@ protected:
   bool GenerateForStaticLibs;
   bool GenerateForSharedLibs;
   bool GenerateForModuleLibs;
+  bool GenerateForInterface;
   bool GenerateForExternals;
   bool GeneratePerTarget;
   bool GenerateDependers;

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

Summary of changes:
 Source/cmGraphVizWriter.cxx |   41 ++++++++++++++++++++++++++---------------
 Source/cmGraphVizWriter.h   |    1 +
 2 files changed, 27 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to