Export: Port some API to cmGlobalGenerator.

This commit is contained in:
Stephen Kelly 2015-10-17 15:01:25 +02:00
parent 97062ac268
commit 2b9cc1e248
7 changed files with 13 additions and 16 deletions

View File

@ -235,14 +235,17 @@ cmExportBuildFileGenerator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmExportBuildFileGenerator::HandleMissingTarget( cmExportBuildFileGenerator::HandleMissingTarget(
std::string& link_libs, std::vector<std::string>& missingTargets, std::string& link_libs,
cmMakefile* mf, cmTarget* depender, cmTarget* dependee) std::vector<std::string>& missingTargets,
cmTarget* depender,
cmTarget* dependee)
{ {
// The target is not in the export. // The target is not in the export.
if(!this->AppendMode) if(!this->AppendMode)
{ {
const std::string name = dependee->GetName(); const std::string name = dependee->GetName();
std::vector<std::string> namespaces = this->FindNamespaces(mf, name); cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator();
std::vector<std::string> namespaces = this->FindNamespaces(gg, name);
int targetOccurrences = (int)namespaces.size(); int targetOccurrences = (int)namespaces.size();
if (targetOccurrences == 1) if (targetOccurrences == 1)
@ -287,10 +290,9 @@ void cmExportBuildFileGenerator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::vector<std::string> std::vector<std::string>
cmExportBuildFileGenerator cmExportBuildFileGenerator
::FindNamespaces(cmMakefile* mf, const std::string& name) ::FindNamespaces(cmGlobalGenerator* gg, const std::string& name)
{ {
std::vector<std::string> namespaces; std::vector<std::string> namespaces;
cmGlobalGenerator* gg = mf->GetGlobalGenerator();
std::map<std::string, cmExportBuildFileGenerator*>& exportSets std::map<std::string, cmExportBuildFileGenerator*>& exportSets
= gg->GetBuildExportSets(); = gg->GetBuildExportSets();

View File

@ -54,7 +54,6 @@ protected:
std::vector<std::string> &missingTargets); std::vector<std::string> &missingTargets);
virtual void HandleMissingTarget(std::string& link_libs, virtual void HandleMissingTarget(std::string& link_libs,
std::vector<std::string>& missingTargets, std::vector<std::string>& missingTargets,
cmMakefile* mf,
cmTarget* depender, cmTarget* depender,
cmTarget* dependee); cmTarget* dependee);
@ -72,7 +71,7 @@ protected:
const std::string& config); const std::string& config);
std::vector<std::string> std::vector<std::string>
FindNamespaces(cmMakefile* mf, const std::string& name); FindNamespaces(cmGlobalGenerator* gg, const std::string& name);
std::vector<std::string> Targets; std::vector<std::string> Targets;
cmExportSet *ExportSet; cmExportSet *ExportSet;

View File

@ -661,7 +661,6 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
{ {
std::string namespacedTarget; std::string namespacedTarget;
this->HandleMissingTarget(namespacedTarget, missingTargets, this->HandleMissingTarget(namespacedTarget, missingTargets,
target->Target->GetMakefile(),
target->Target, tgt->Target); target->Target, tgt->Target);
if (!namespacedTarget.empty()) if (!namespacedTarget.empty())
{ {

View File

@ -119,7 +119,6 @@ protected:
* export set. */ * export set. */
virtual void HandleMissingTarget(std::string& link_libs, virtual void HandleMissingTarget(std::string& link_libs,
std::vector<std::string>& missingTargets, std::vector<std::string>& missingTargets,
cmMakefile* mf,
cmTarget* depender, cmTarget* depender,
cmTarget* dependee) = 0; cmTarget* dependee) = 0;
void PopulateInterfaceProperty(const std::string&, void PopulateInterfaceProperty(const std::string&,

View File

@ -455,10 +455,11 @@ cmExportInstallFileGenerator
void void
cmExportInstallFileGenerator::HandleMissingTarget( cmExportInstallFileGenerator::HandleMissingTarget(
std::string& link_libs, std::vector<std::string>& missingTargets, std::string& link_libs, std::vector<std::string>& missingTargets,
cmMakefile* mf, cmTarget* depender, cmTarget* dependee) cmTarget* depender, cmTarget* dependee)
{ {
const std::string name = dependee->GetName(); const std::string name = dependee->GetName();
std::vector<std::string> namespaces = this->FindNamespaces(mf, name); cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator();
std::vector<std::string> namespaces = this->FindNamespaces(gg, name);
int targetOccurrences = (int)namespaces.size(); int targetOccurrences = (int)namespaces.size();
if (targetOccurrences == 1) if (targetOccurrences == 1)
{ {
@ -479,10 +480,9 @@ cmExportInstallFileGenerator::HandleMissingTarget(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::vector<std::string> std::vector<std::string>
cmExportInstallFileGenerator cmExportInstallFileGenerator
::FindNamespaces(cmMakefile* mf, const std::string& name) ::FindNamespaces(cmGlobalGenerator* gg, const std::string& name)
{ {
std::vector<std::string> namespaces; std::vector<std::string> namespaces;
cmGlobalGenerator* gg = mf->GetGlobalGenerator();
const cmExportSetMap& exportSets = gg->GetExportSets(); const cmExportSetMap& exportSets = gg->GetExportSets();
for(cmExportSetMap::const_iterator expIt = exportSets.begin(); for(cmExportSetMap::const_iterator expIt = exportSets.begin();

View File

@ -57,7 +57,6 @@ protected:
std::vector<std::string> &missingTargets); std::vector<std::string> &missingTargets);
virtual void HandleMissingTarget(std::string& link_libs, virtual void HandleMissingTarget(std::string& link_libs,
std::vector<std::string>& missingTargets, std::vector<std::string>& missingTargets,
cmMakefile* mf,
cmTarget* depender, cmTarget* depender,
cmTarget* dependee); cmTarget* dependee);
@ -67,7 +66,7 @@ protected:
cmTarget* dependee, cmTarget* dependee,
int occurrences); int occurrences);
std::vector<std::string> FindNamespaces(cmMakefile* mf, std::vector<std::string> FindNamespaces(cmGlobalGenerator* gg,
const std::string& name); const std::string& name);

View File

@ -37,7 +37,6 @@ protected:
std::vector<std::string>&) {} std::vector<std::string>&) {}
virtual void HandleMissingTarget(std::string&, virtual void HandleMissingTarget(std::string&,
std::vector<std::string>&, std::vector<std::string>&,
cmMakefile*,
cmTarget*, cmTarget*,
cmTarget*) {} cmTarget*) {}