[Cmake-commits] CMake branch, next, updated. v3.0.0-3940-g9100f2e

Brad King brad.king at kitware.com
Wed Jun 25 13:13:16 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  9100f2ea73a03cd38a7faddecebac7d193fad3a3 (commit)
       via  0192be51819f8765131fc059b3ee210011eb7b80 (commit)
       via  6ead631bf9ec6da8eeca5fb39e5eba80e5022f15 (commit)
       via  b030a7f1ca89620ad4b51569c991a7c0b8aa05c2 (commit)
       via  1001490df27f3ab93f8a37a6f6c3b33aa26d22e2 (commit)
      from  111b0136a6bf91bd6b9ae9a0d00710c72e1313bd (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=9100f2ea73a03cd38a7faddecebac7d193fad3a3
commit 9100f2ea73a03cd38a7faddecebac7d193fad3a3
Merge: 111b013 0192be5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jun 25 13:13:15 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jun 25 13:13:15 2014 -0400

    Merge topic 'refactor-link-internals' into next
    
    0192be51 cmTarget: De-duplicate link interface evaluation for $<LINK_ONLY>
    6ead631b cmTarget: Teach GetLinkInterfaceLibraries to support $<LINK_ONLY>
    b030a7f1 cmTarget: De-duplicate link interface genex code for $<LINK_ONLY>
    1001490d cmTarget: Teach ExpandLinkItems how to support $<LINK_ONLY>


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0192be51819f8765131fc059b3ee210011eb7b80
commit 0192be51819f8765131fc059b3ee210011eb7b80
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 16 14:27:42 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 25 10:20:52 2014 -0400

    cmTarget: De-duplicate link interface evaluation for $<LINK_ONLY>
    
    Teach GetTransitivePropertyTargets to use the GetLinkInterfaceLibraries
    method with usage_requirements_only==true instead of evaluating the
    INTERFACE_LINK_LIBRARIES property directly.  This avoids duplicate
    evaluations and makes use of the caching done by
    GetLinkInterfaceLibraries.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 325357d..cb52e15 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6219,15 +6219,18 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
                                       cmTarget const* headTarget,
                                       std::vector<cmTarget const*> &tgts) const
 {
-  cmTarget::LinkInterface const* iface
-    = this->GetLinkInterfaceLibraries(config, headTarget, false);
-  if (!iface)
-    {
-    return;
-    }
-  if(this->GetType() != STATIC_LIBRARY
-      || this->GetPolicyStatusCMP0022() == cmPolicies::WARN
-      || this->GetPolicyStatusCMP0022() == cmPolicies::OLD)
+  // The $<LINK_ONLY> expression may be in a link interface to specify private
+  // link dependencies that are otherwise excluded from usage requirements.
+  // Currently $<LINK_ONLY> is internal to CMake and only ever added by
+  // target_link_libraries for PRIVATE dependencies of STATIC libraries in
+  // INTERFACE_LINK_LIBRARIES which is used under CMP0022 NEW behavior.
+  bool usage_requirements_only =
+    this->GetType() == STATIC_LIBRARY &&
+    this->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
+    this->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+  if(cmTarget::LinkInterface const* iface =
+     this->GetLinkInterfaceLibraries(config, headTarget,
+                                     usage_requirements_only))
     {
     for(std::vector<cmLinkItem>::const_iterator it = iface->Libraries.begin();
         it != iface->Libraries.end(); ++it)
@@ -6237,29 +6240,6 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
         tgts.push_back(it->Target);
         }
       }
-    return;
-    }
-
-  const char* linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
-  const char* interfaceLibs = this->GetProperty(linkIfaceProp);
-
-  if (!interfaceLibs)
-    {
-    return;
-    }
-
-  // The interface libraries have been explicitly set.
-  std::vector<cmLinkItem> libs;
-  this->ExpandLinkItems(linkIfaceProp, interfaceLibs, config,
-                        headTarget, true, libs);
-
-  for(std::vector<cmLinkItem>::const_iterator it = libs.begin();
-      it != libs.end(); ++it)
-    {
-    if (it->Target)
-      {
-      tgts.push_back(it->Target);
-      }
     }
 }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ead631bf9ec6da8eeca5fb39e5eba80e5022f15
commit 6ead631bf9ec6da8eeca5fb39e5eba80e5022f15
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 16 14:27:42 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 25 10:01:56 2014 -0400

    cmTarget: Teach GetLinkInterfaceLibraries to support $<LINK_ONLY>
    
    Add a 'usage_requirements_only' parameter to GetLinkInterfaceLibraries
    and supporting internal APIs to pass through to ExpandLinkItems so it
    knows whether to use SetTransitivePropertiesOnly while evaluating
    generator expressions.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c4fd924..325357d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -126,11 +126,13 @@ public:
   typedef std::map<TargetConfigPair, OptionalLinkInterface>
                                                           LinkInterfaceMapType;
   LinkInterfaceMapType LinkInterfaceMap;
+  LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap;
   bool PolicyWarnedCMP0022;
 
   typedef std::map<TargetConfigPair, cmTarget::LinkInterface>
                                                     ImportLinkInterfaceMapType;
   ImportLinkInterfaceMapType ImportLinkInterfaceMap;
+  ImportLinkInterfaceMapType ImportLinkInterfaceUsageRequirementsOnlyMap;
 
   typedef std::map<std::string, cmTarget::OutputInfo> OutputInfoMapType;
   OutputInfoMapType OutputInfoMap;
@@ -510,7 +512,9 @@ void cmTarget::ClearLinkMaps()
   this->LinkImplementationLanguageIsContextDependent = true;
   this->Internal->LinkImplMap.clear();
   this->Internal->LinkInterfaceMap.clear();
+  this->Internal->LinkInterfaceUsageRequirementsOnlyMap.clear();
   this->Internal->ImportLinkInterfaceMap.clear();
+  this->Internal->ImportLinkInterfaceUsageRequirementsOnlyMap.clear();
   this->Internal->LinkClosureMap.clear();
   for (cmTargetLinkInformationMap::const_iterator it
       = this->LinkInformation.begin();
@@ -6037,7 +6041,7 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
   // Imported targets have their own link interface.
   if(this->IsImported())
     {
-    return this->GetImportLinkInterface(config, head);
+    return this->GetImportLinkInterface(config, head, false);
     }
 
   // Link interfaces are not supported for executables that do not
@@ -6058,7 +6062,8 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
     // Compute the link interface for this configuration.
     cmTargetInternals::OptionalLinkInterface iface;
     iface.ExplicitLibraries =
-        this->ComputeLinkInterfaceLibraries(config, iface, head, iface.Exists);
+      this->ComputeLinkInterfaceLibraries(config, iface, head, false,
+                                          iface.Exists);
     if (iface.Exists)
       {
       this->Internal->ComputeLinkInterface(this, config, iface,
@@ -6081,12 +6086,13 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
 //----------------------------------------------------------------------------
 cmTarget::LinkInterface const*
 cmTarget::GetLinkInterfaceLibraries(const std::string& config,
-                                    cmTarget const* head) const
+                                    cmTarget const* head,
+                                    bool usage_requirements_only) const
 {
   // Imported targets have their own link interface.
   if(this->IsImported())
     {
-    return this->GetImportLinkInterface(config, head);
+    return this->GetImportLinkInterface(config, head, usage_requirements_only);
     }
 
   // Link interfaces are not supported for executables that do not
@@ -6099,21 +6105,24 @@ cmTarget::GetLinkInterfaceLibraries(const std::string& config,
 
   // Lookup any existing link interface for this configuration.
   TargetConfigPair key(head, cmSystemTools::UpperCase(config));
+  cmTargetInternals::LinkInterfaceMapType& lim =
+    (usage_requirements_only ?
+     this->Internal->LinkInterfaceUsageRequirementsOnlyMap :
+     this->Internal->LinkInterfaceMap);
 
-  cmTargetInternals::LinkInterfaceMapType::iterator
-    i = this->Internal->LinkInterfaceMap.find(key);
-  if(i == this->Internal->LinkInterfaceMap.end())
+  cmTargetInternals::LinkInterfaceMapType::iterator i = lim.find(key);
+  if(i == lim.end())
     {
     // Compute the link interface for this configuration.
     cmTargetInternals::OptionalLinkInterface iface;
-    iface.ExplicitLibraries = this->ComputeLinkInterfaceLibraries(config,
-                                                                iface,
-                                                                head,
-                                                                iface.Exists);
+    iface.ExplicitLibraries =
+      this->ComputeLinkInterfaceLibraries(config, iface, head,
+                                          usage_requirements_only,
+                                          iface.Exists);
 
     // Store the information for this configuration.
     cmTargetInternals::LinkInterfaceMapType::value_type entry(key, iface);
-    i = this->Internal->LinkInterfaceMap.insert(entry).first;
+    i = lim.insert(entry).first;
     }
 
   return i->second.Exists ? &i->second : 0;
@@ -6122,7 +6131,8 @@ cmTarget::GetLinkInterfaceLibraries(const std::string& config,
 //----------------------------------------------------------------------------
 cmTarget::LinkInterface const*
 cmTarget::GetImportLinkInterface(const std::string& config,
-                                 cmTarget const* headTarget) const
+                                 cmTarget const* headTarget,
+                                 bool usage_requirements_only) const
 {
   cmTarget::ImportInfo const* info = this->GetImportInfo(config);
   if(!info)
@@ -6131,16 +6141,20 @@ cmTarget::GetImportLinkInterface(const std::string& config,
     }
 
   TargetConfigPair key(headTarget, cmSystemTools::UpperCase(config));
+  cmTargetInternals::ImportLinkInterfaceMapType& lim =
+    (usage_requirements_only ?
+     this->Internal->ImportLinkInterfaceUsageRequirementsOnlyMap :
+     this->Internal->ImportLinkInterfaceMap);
 
-  cmTargetInternals::ImportLinkInterfaceMapType::iterator i =
-    this->Internal->ImportLinkInterfaceMap.find(key);
-  if(i == this->Internal->ImportLinkInterfaceMap.end())
+  cmTargetInternals::ImportLinkInterfaceMapType::iterator i = lim.find(key);
+  if(i == lim.end())
     {
     LinkInterface iface;
     iface.Multiplicity = info->Multiplicity;
     cmSystemTools::ExpandListArgument(info->Languages, iface.Languages);
     this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config,
-                          headTarget, false, iface.Libraries);
+                          headTarget, usage_requirements_only,
+                          iface.Libraries);
     {
     std::vector<std::string> deps;
     cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
@@ -6149,7 +6163,7 @@ cmTarget::GetImportLinkInterface(const std::string& config,
 
     cmTargetInternals::ImportLinkInterfaceMapType::value_type
       entry(key, iface);
-    i = this->Internal->ImportLinkInterfaceMap.insert(entry).first;
+    i = lim.insert(entry).first;
     }
   return &i->second;
 }
@@ -6165,7 +6179,7 @@ void processILibs(const std::string& config,
     {
     tgts.push_back(item.Target);
     if(cmTarget::LinkInterface const* iface =
-       item.Target->GetLinkInterfaceLibraries(config, headTarget))
+       item.Target->GetLinkInterfaceLibraries(config, headTarget, false))
       {
       for(std::vector<cmLinkItem>::const_iterator
             it = iface->Libraries.begin();
@@ -6206,7 +6220,7 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
                                       std::vector<cmTarget const*> &tgts) const
 {
   cmTarget::LinkInterface const* iface
-                        = this->GetLinkInterfaceLibraries(config, headTarget);
+    = this->GetLinkInterfaceLibraries(config, headTarget, false);
   if (!iface)
     {
     return;
@@ -6253,6 +6267,7 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
 const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
                                            LinkInterface& iface,
                                            cmTarget const* headTarget,
+                                           bool usage_requirements_only,
                                            bool &exists) const
 {
   // Construct the property name suffix for this configuration.
@@ -6338,7 +6353,8 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
     {
     // The interface libraries have been explicitly set.
     this->ExpandLinkItems(linkIfaceProp, explicitLibraries, config,
-                          headTarget, false, iface.Libraries);
+                          headTarget, usage_requirements_only,
+                          iface.Libraries);
     }
   else if (this->PolicyStatusCMP0022 == cmPolicies::WARN
         || this->PolicyStatusCMP0022 == cmPolicies::OLD)
@@ -6352,7 +6368,7 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
         this->GetLinkImplementationLibrariesInternal(config, headTarget);
     iface.Libraries = impl->Libraries;
     if(this->PolicyStatusCMP0022 == cmPolicies::WARN &&
-       !this->Internal->PolicyWarnedCMP0022)
+       !this->Internal->PolicyWarnedCMP0022 && !usage_requirements_only)
       {
       // Compare the link implementation fallback link interface to the
       // preferred new link interface property and warn if different.
@@ -6361,7 +6377,8 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
       if(const char* newExplicitLibraries = this->GetProperty(newProp))
         {
         this->ExpandLinkItems(newProp, newExplicitLibraries, config,
-                              headTarget, false, ifaceLibs);
+                              headTarget, usage_requirements_only,
+                              ifaceLibs);
         }
       if (ifaceLibs != impl->Libraries)
         {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 4930d70..9d1f966 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -280,7 +280,8 @@ public:
   LinkInterface const* GetLinkInterface(const std::string& config,
                                         cmTarget const* headTarget) const;
   LinkInterface const* GetLinkInterfaceLibraries(const std::string& config,
-                                        cmTarget const* headTarget) const;
+                                        cmTarget const* headTarget,
+                                        bool usage_requirements_only) const;
   void GetTransitivePropertyTargets(const std::string& config,
                                     cmTarget const* headTarget,
                                     std::vector<cmTarget const*> &libs) const;
@@ -756,12 +757,13 @@ private:
                                   const std::string& config) const;
 
   LinkInterface const*
-    GetImportLinkInterface(const std::string& config,
-                           cmTarget const* head) const;
+    GetImportLinkInterface(const std::string& config, cmTarget const* head,
+                           bool usage_requirements_only) const;
 
   const char* ComputeLinkInterfaceLibraries(const std::string& config,
                                             LinkInterface& iface,
                                             cmTarget const* head,
+                                            bool usage_requirements_only,
                                             bool &exists) const;
 
   LinkImplementation const*

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b030a7f1ca89620ad4b51569c991a7c0b8aa05c2
commit b030a7f1ca89620ad4b51569c991a7c0b8aa05c2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 16 14:25:40 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 25 09:32:38 2014 -0400

    cmTarget: De-duplicate link interface genex code for $<LINK_ONLY>
    
    Simplify the implementation of GetTransitivePropertyTargets by using
    ExpandLinkItems with usage_requirements_only==true to evaluate the
    generator expressions in the link interface for us.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 32948cd..c4fd924 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6235,24 +6235,16 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
     }
 
   // The interface libraries have been explicitly set.
-  cmGeneratorExpression ge;
-  cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
-                                             linkIfaceProp, 0, 0);
-  dagChecker.SetTransitivePropertiesOnly();
-  std::vector<std::string> libs;
-  cmSystemTools::ExpandListArgument(ge.Parse(interfaceLibs)->Evaluate(
-                                      this->Makefile,
-                                      config,
-                                      false,
-                                      headTarget,
-                                      this, &dagChecker), libs);
+  std::vector<cmLinkItem> libs;
+  this->ExpandLinkItems(linkIfaceProp, interfaceLibs, config,
+                        headTarget, true, libs);
 
-  for(std::vector<std::string>::const_iterator it = libs.begin();
+  for(std::vector<cmLinkItem>::const_iterator it = libs.begin();
       it != libs.end(); ++it)
     {
-    if (cmTarget const* tgt = this->FindTargetToLink(*it))
+    if (it->Target)
       {
-      tgts.push_back(tgt);
+      tgts.push_back(it->Target);
       }
     }
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1001490df27f3ab93f8a37a6f6c3b33aa26d22e2
commit 1001490df27f3ab93f8a37a6f6c3b33aa26d22e2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 16 14:23:22 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 25 09:32:21 2014 -0400

    cmTarget: Teach ExpandLinkItems how to support $<LINK_ONLY>
    
    Add a 'usage_requirements_only' parameter to ExpandLinkItems so that it
    knows whether to use SetTransitivePropertiesOnly while evaluating
    generator expressions.  Update existing call sites to pass 'false' since
    they are for linking and not usage requirements.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 71d03df..32948cd 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3688,10 +3688,15 @@ void cmTarget::ExpandLinkItems(std::string const& prop,
                                std::string const& value,
                                std::string const& config,
                                cmTarget const* headTarget,
+                               bool usage_requirements_only,
                                std::vector<cmLinkItem>& items) const
 {
   cmGeneratorExpression ge;
   cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, 0, 0);
+  if(usage_requirements_only)
+    {
+    dagChecker.SetTransitivePropertiesOnly();
+    }
   std::vector<std::string> libs;
   cmSystemTools::ExpandListArgument(ge.Parse(value)->Evaluate(
                                       this->Makefile,
@@ -6135,7 +6140,7 @@ cmTarget::GetImportLinkInterface(const std::string& config,
     iface.Multiplicity = info->Multiplicity;
     cmSystemTools::ExpandListArgument(info->Languages, iface.Languages);
     this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config,
-                          headTarget, iface.Libraries);
+                          headTarget, false, iface.Libraries);
     {
     std::vector<std::string> deps;
     cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
@@ -6341,7 +6346,7 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
     {
     // The interface libraries have been explicitly set.
     this->ExpandLinkItems(linkIfaceProp, explicitLibraries, config,
-                          headTarget, iface.Libraries);
+                          headTarget, false, iface.Libraries);
     }
   else if (this->PolicyStatusCMP0022 == cmPolicies::WARN
         || this->PolicyStatusCMP0022 == cmPolicies::OLD)
@@ -6364,7 +6369,7 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
       if(const char* newExplicitLibraries = this->GetProperty(newProp))
         {
         this->ExpandLinkItems(newProp, newExplicitLibraries, config,
-                              headTarget, ifaceLibs);
+                              headTarget, false, ifaceLibs);
         }
       if (ifaceLibs != impl->Libraries)
         {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 3f534f2..4930d70 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -777,6 +777,7 @@ private:
 
   void ExpandLinkItems(std::string const& prop, std::string const& value,
                        std::string const& config, cmTarget const* headTarget,
+                       bool usage_requirements_only,
                        std::vector<cmLinkItem>& items) const;
   void LookupLinkItems(std::vector<std::string> const& names,
                        std::vector<cmLinkItem>& items) const;

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list