Browse Source

cmComputeLinkInformation: Port data interface to cmGeneratorTarget.

Stephen Kelly 10 years ago
parent
commit
c7645fca12

+ 5 - 7
Source/cmCommonTargetGenerator.cxx

@@ -391,21 +391,19 @@ cmCommonTargetGenerator::GetLinkedTargetDirectories() const
     for(cmComputeLinkInformation::ItemVector::const_iterator
           i = items.begin(); i != items.end(); ++i)
       {
-      cmTarget const* linkee = i->Target;
+      cmGeneratorTarget const* linkee = i->Target;
       if(linkee && !linkee->IsImported()
                 // We can ignore the INTERFACE_LIBRARY items because
                 // Target->GetLinkInformation already processed their
                 // link interface and they don't have any output themselves.
                 && linkee->GetType() != cmTarget::INTERFACE_LIBRARY
-                && emitted.insert(linkee).second)
+                && emitted.insert(linkee->Target).second)
         {
-        cmGeneratorTarget* gt =
-          this->GlobalGenerator->GetGeneratorTarget(linkee);
-        cmLocalGenerator* lg = gt->GetLocalGenerator();
-        cmMakefile* mf = linkee->GetMakefile();
+        cmLocalGenerator* lg = linkee->GetLocalGenerator();
+        cmMakefile* mf = linkee->Target->GetMakefile();
         std::string di = mf->GetCurrentBinaryDirectory();
         di += "/";
-        di += lg->GetTargetDirectory(*linkee);
+        di += lg->GetTargetDirectory(*linkee->Target);
         dirs.push_back(di);
         }
       }

+ 3 - 3
Source/cmComputeLinkInformation.cxx

@@ -658,7 +658,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
       std::string exe = tgt->GetFullPath(config, this->UseImportLibrary,
                                          true);
       linkItem += exe;
-      this->Items.push_back(Item(linkItem, true, tgt->Target));
+      this->Items.push_back(Item(linkItem, true, tgt));
       this->Depends.push_back(exe);
       }
     else if(tgt->GetType() == cmTarget::INTERFACE_LIBRARY)
@@ -666,7 +666,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
       // Add the interface library as an item so it can be considered as part
       // of COMPATIBLE_INTERFACE_ enforcement.  The generators will ignore
       // this for the actual link line.
-      this->Items.push_back(Item(std::string(), true, tgt->Target));
+      this->Items.push_back(Item(std::string(), true, tgt));
       }
     else
       {
@@ -1120,7 +1120,7 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item,
     }
 
   // Now add the full path to the library.
-  this->Items.push_back(Item(item, true, target->Target));
+  this->Items.push_back(Item(item, true, target));
 }
 
 //----------------------------------------------------------------------------

+ 2 - 2
Source/cmComputeLinkInformation.h

@@ -39,11 +39,11 @@ public:
     Item(): Value(), IsPath(true), Target(0) {}
     Item(Item const& item):
       Value(item.Value), IsPath(item.IsPath), Target(item.Target) {}
-    Item(std::string const& v, bool p, cmTarget const* target = 0):
+    Item(std::string const& v, bool p, cmGeneratorTarget const* target = 0):
       Value(v), IsPath(p), Target(target) {}
     std::string Value;
     bool IsPath;
-    cmTarget const* Target;
+    cmGeneratorTarget const* Target;
   };
   typedef std::vector<Item> ItemVector;
   ItemVector const& GetItems();

+ 7 - 6
Source/cmExportFileGenerator.cxx

@@ -517,8 +517,9 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
 
 
 //----------------------------------------------------------------------------
-void getPropertyContents(cmTarget const* tgt, const std::string& prop,
-         std::set<std::string> &ifaceProperties)
+void getPropertyContents(cmGeneratorTarget const* tgt,
+                         const std::string& prop,
+                         std::set<std::string> &ifaceProperties)
 {
   const char *p = tgt->GetProperty(prop);
   if (!p)
@@ -589,11 +590,11 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
 
   std::set<std::string> ifaceProperties;
 
-  getPropertyContents(target, "COMPATIBLE_INTERFACE_BOOL", ifaceProperties);
-  getPropertyContents(target, "COMPATIBLE_INTERFACE_STRING", ifaceProperties);
-  getPropertyContents(target, "COMPATIBLE_INTERFACE_NUMBER_MIN",
+  getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_BOOL", ifaceProperties);
+  getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_STRING", ifaceProperties);
+  getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_NUMBER_MIN",
                       ifaceProperties);
-  getPropertyContents(target, "COMPATIBLE_INTERFACE_NUMBER_MAX",
+  getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_NUMBER_MAX",
                       ifaceProperties);
 
   if (target->GetType() != cmTarget::INTERFACE_LIBRARY)

+ 2 - 2
Source/cmGeneratorTarget.cxx

@@ -3735,7 +3735,7 @@ const char * getLinkInterfaceDependentProperty(cmGeneratorTarget const* tgt,
 //----------------------------------------------------------------------------
 template<typename PropertyType>
 void checkPropertyConsistency(cmGeneratorTarget const* depender,
-                              cmTarget const* dependee,
+                              cmGeneratorTarget const* dependee,
                               const std::string& propName,
                               std::set<std::string> &emitted,
                               const std::string& config,
@@ -3751,7 +3751,7 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender,
   std::vector<std::string> props;
   cmSystemTools::ExpandListArgument(prop, props);
   std::string pdir =
-    dependee->GetMakefile()->GetRequiredDefinition("CMAKE_ROOT");
+    dependee->Target->GetMakefile()->GetRequiredDefinition("CMAKE_ROOT");
   pdir += "/Help/prop_tgt/";
 
   for(std::vector<std::string>::iterator pi = props.begin();