[Cmake-commits] CMake branch, next, updated. v2.8.10.2-1662-ge176495

Stephen Kelly steveire at gmail.com
Sun Jan 20 05:12:19 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  e1764952b79d9da74e9c30b8597e01d53414d964 (commit)
       via  db3adfc0cbed03ae18361c8bb5ec3be89d6c089b (commit)
      from  6669ef999cb381b167f49971c103165e481e1ff8 (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=e1764952b79d9da74e9c30b8597e01d53414d964
commit e1764952b79d9da74e9c30b8597e01d53414d964
Merge: 6669ef9 db3adfc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 20 05:12:15 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jan 20 05:12:15 2013 -0500

    Merge topic 'fix-COMPATIBLE_INTERFACE-properties' into next
    
    db3adfc Evaluate link-dependent interface properties in generator expressions


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db3adfc0cbed03ae18361c8bb5ec3be89d6c089b
commit db3adfc0cbed03ae18361c8bb5ec3be89d6c089b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 20 10:48:40 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 20 11:10:07 2013 +0100

    Evaluate link-dependent interface properties in generator expressions
    
    The approach in the parent commit is wrong, because the property access
    which implied it to be null could have been config dependent. That means
    that we can't just assign the property the first value that is defined
    for any config.
    
    Instead we can evaluate the interface dependent property through the
    link interface again while evaluating the generator expression.

diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 2e5b5ae..057f4c3 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -106,3 +106,16 @@ cmGeneratorExpressionDAGChecker::checkGraph() const
     }
   return DAG;
 }
+
+//----------------------------------------------------------------------------
+bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries()
+{
+  const cmGeneratorExpressionDAGChecker *top = this;
+  const cmGeneratorExpressionDAGChecker *parent = this->Parent;
+  while (parent)
+    {
+    parent = parent->Parent;
+    top = parent;
+    }
+  return top->Property == "LINK_LIBRARIES";
+}
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 48f26ed..3169291 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -35,6 +35,9 @@ struct cmGeneratorExpressionDAGChecker
 
   void reportError(cmGeneratorExpressionContext *context,
                    const std::string &expr);
+
+  bool EvaluatingLinkLibraries();
+
 private:
   Result checkGraph() const;
 
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 8e40815..e842880 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -442,6 +442,27 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
     const char *prop = target->GetProperty(propertyName.c_str());
     if (!prop)
       {
+      if (target->IsImported())
+        {
+        return std::string();
+        }
+      if (dagCheckerParent && dagCheckerParent->EvaluatingLinkLibraries())
+        {
+        return std::string();
+        }
+      if (propertyName == "POSITION_INDEPENDENT_CODE")
+        {
+        return target->GetLinkInterfaceDependentBoolProperty(
+                    "POSITION_INDEPENDENT_CODE", context->Config) ? "1" : "0";
+        }
+      if (target->IsLinkInterfaceDependentBoolProperty(propertyName,
+                                                       context->Config))
+        {
+        return target->GetLinkInterfaceDependentBoolProperty(
+                                                propertyName,
+                                                context->Config) ? "1" : "0";
+        }
+
       return std::string();
       }
 
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 0b5c43c..d2baf53 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1097,8 +1097,6 @@ void cmGlobalGenerator::CreateGeneratorTargets()
       {
       cmTarget* t = &ti->second;
 
-      t->SpecifyImplicitProperties();
-
       {
       t->AppendProperty("COMPILE_DEFINITIONS", noconfig_compile_definitions);
       for(std::vector<std::string>::const_iterator ci = configs.begin();
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2cf5e88..0493aec 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4613,6 +4613,53 @@ bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
 }
 
 //----------------------------------------------------------------------------
+bool isLinkDependentProperty(cmTarget *tgt, const std::string &p,
+                             const char *interfaceProperty,
+                             const char *config)
+{
+  cmComputeLinkInformation *info = tgt->GetLinkInformation(config);
+
+  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
+
+  for(cmComputeLinkInformation::ItemVector::const_iterator li =
+      deps.begin();
+      li != deps.end(); ++li)
+    {
+    if (!li->Target)
+      {
+      continue;
+      }
+    const char *prop = li->Target->GetProperty(interfaceProperty);
+    if (!prop)
+      {
+      return false;
+      }
+
+    std::vector<std::string> props;
+    cmSystemTools::ExpandListArgument(prop, props);
+
+    for(std::vector<std::string>::iterator pi = props.begin();
+        pi != props.end(); ++pi)
+      {
+      if (*pi == p)
+        {
+        return true;
+        }
+      }
+    }
+
+  return false;
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
+                                           const char *config)
+{
+  return isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_BOOL",
+                                 config);
+}
+
+//----------------------------------------------------------------------------
 void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
 {
   for(std::vector<cmSourceFile*>::const_iterator
@@ -5405,105 +5452,6 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
 }
 
 //----------------------------------------------------------------------------
-void setImplicitProperty(cmTarget *depender, cmTarget *dependee,
-                         const char *propName,
-                         std::set<cmStdString> &emitted,
-                         const char *config)
-{
-  const char *prop = dependee->GetProperty(propName);
-  if (!prop)
-    {
-    return;
-    }
-
-  std::vector<std::string> props;
-  cmSystemTools::ExpandListArgument(prop, props);
-
-  for(std::vector<std::string>::iterator pi = props.begin();
-      pi != props.end(); ++pi)
-    {
-    if(emitted.insert(*pi).second)
-      {
-      if (depender->GetProperty(pi->c_str()))
-        {
-        continue;
-        }
-      bool result = depender->GetLinkInterfaceDependentBoolProperty(
-                                                                  pi->c_str(),
-                                                                  config);
-
-      if (cmSystemTools::GetErrorOccuredFlag())
-        {
-        return;
-        }
-      depender->SetProperty(pi->c_str(), result ? "ON" : "OFF");
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::SpecifyImplicitProperties(const char *config)
-{
-  cmComputeLinkInformation* info = this->GetLinkInformation(config);
-
-  if (!info)
-    {
-    return;
-    }
-
-  {
-  if (!this->GetProperty("POSITION_INDEPENDENT_CODE"))
-    {
-    bool pic_result
-              = this->GetLinkInterfaceDependentBoolProperty(
-                                                  "POSITION_INDEPENDENT_CODE",
-                                                  config);
-    if (cmSystemTools::GetErrorOccuredFlag())
-      {
-      return;
-      }
-    this->SetProperty("POSITION_INDEPENDENT_CODE", pic_result ? "ON" : "OFF");
-    }
-  }
-
-  const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
-
-  std::set<cmStdString> emitted;
-
-  for(cmComputeLinkInformation::ItemVector::const_iterator li =
-      deps.begin();
-      li != deps.end(); ++li)
-    {
-    if (!li->Target)
-      {
-      continue;
-      }
-
-    setImplicitProperty(this, li->Target,
-                              "COMPATIBLE_INTERFACE_BOOL", emitted, config);
-    if (cmSystemTools::GetErrorOccuredFlag())
-      {
-      return;
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-void cmTarget::SpecifyImplicitProperties()
-{
-  this->SpecifyImplicitProperties(0);
-
-  std::vector<std::string> configNames;
-  this->Makefile->GetConfigurations(configNames);
-
-  for (std::vector<std::string>::const_iterator ci = configNames.begin();
-    ci != configNames.end(); ++ci)
-    {
-    this->SpecifyImplicitProperties(ci->c_str());
-    }
-}
-
-//----------------------------------------------------------------------------
 cmComputeLinkInformation*
 cmTarget::GetLinkInformation(const char* config, cmTarget *head)
 {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index b229132..b3e17b2 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -495,7 +495,8 @@ public:
   void GetLinkDependentTargetsForProperty(const std::string &p,
                                        std::set<std::string> &targets);
   bool IsNullImpliedByLinkLibraries(const std::string &p);
-  void SpecifyImplicitProperties();
+  bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
+                                            const char *config);
 
   void AddLinkDependentTargetsForProperties(
           const std::map<cmStdString, cmStdString> &map);
@@ -649,8 +650,6 @@ private:
   std::string GetDebugGeneratorExpressions(const std::string &value,
                                   cmTarget::LinkLibraryType llt);
 
-  void SpecifyImplicitProperties(const char *config);
-
   // The cmMakefile instance that owns this target.  This should
   // always be set.
   cmMakefile* Makefile;

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

Summary of changes:
 Source/cmGeneratorExpressionDAGChecker.cxx |   13 +++
 Source/cmGeneratorExpressionDAGChecker.h   |    3 +
 Source/cmGeneratorExpressionEvaluator.cxx  |   21 ++++
 Source/cmGlobalGenerator.cxx               |    2 -
 Source/cmTarget.cxx                        |  146 +++++++++-------------------
 Source/cmTarget.h                          |    5 +-
 6 files changed, 86 insertions(+), 104 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list