cmComputeLinkInformation: Port data interface to cmGeneratorTarget.

This commit is contained in:
Stephen Kelly 2015-10-08 00:49:38 +02:00
parent ce8894aaf0
commit c7645fca12
5 changed files with 19 additions and 20 deletions

View File

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

View File

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

View File

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

View File

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

View File

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