From 2b9cc1e24871c6b527900e119640ef0adf706f0d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 17 Oct 2015 15:01:25 +0200 Subject: Export: Port some API to cmGlobalGenerator. --- Source/cmExportBuildFileGenerator.cxx | 12 +++++++----- Source/cmExportBuildFileGenerator.h | 3 +-- Source/cmExportFileGenerator.cxx | 1 - Source/cmExportFileGenerator.h | 1 - Source/cmExportInstallFileGenerator.cxx | 8 ++++---- Source/cmExportInstallFileGenerator.h | 3 +-- Source/cmExportTryCompileFileGenerator.h | 1 - 7 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 194d9a2..c24138f 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -235,14 +235,17 @@ cmExportBuildFileGenerator //---------------------------------------------------------------------------- void cmExportBuildFileGenerator::HandleMissingTarget( - std::string& link_libs, std::vector& missingTargets, - cmMakefile* mf, cmTarget* depender, cmTarget* dependee) + std::string& link_libs, + std::vector& missingTargets, + cmTarget* depender, + cmTarget* dependee) { // The target is not in the export. if(!this->AppendMode) { const std::string name = dependee->GetName(); - std::vector namespaces = this->FindNamespaces(mf, name); + cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator(); + std::vector namespaces = this->FindNamespaces(gg, name); int targetOccurrences = (int)namespaces.size(); if (targetOccurrences == 1) @@ -287,10 +290,9 @@ void cmExportBuildFileGenerator //---------------------------------------------------------------------------- std::vector cmExportBuildFileGenerator -::FindNamespaces(cmMakefile* mf, const std::string& name) +::FindNamespaces(cmGlobalGenerator* gg, const std::string& name) { std::vector namespaces; - cmGlobalGenerator* gg = mf->GetGlobalGenerator(); std::map& exportSets = gg->GetBuildExportSets(); diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h index 16695f1..c7d317f 100644 --- a/Source/cmExportBuildFileGenerator.h +++ b/Source/cmExportBuildFileGenerator.h @@ -54,7 +54,6 @@ protected: std::vector &missingTargets); virtual void HandleMissingTarget(std::string& link_libs, std::vector& missingTargets, - cmMakefile* mf, cmTarget* depender, cmTarget* dependee); @@ -72,7 +71,7 @@ protected: const std::string& config); std::vector - FindNamespaces(cmMakefile* mf, const std::string& name); + FindNamespaces(cmGlobalGenerator* gg, const std::string& name); std::vector Targets; cmExportSet *ExportSet; diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 0985542..192a932 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -661,7 +661,6 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input, { std::string namespacedTarget; this->HandleMissingTarget(namespacedTarget, missingTargets, - target->Target->GetMakefile(), target->Target, tgt->Target); if (!namespacedTarget.empty()) { diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index 3280a03..e1ff83d 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -119,7 +119,6 @@ protected: * export set. */ virtual void HandleMissingTarget(std::string& link_libs, std::vector& missingTargets, - cmMakefile* mf, cmTarget* depender, cmTarget* dependee) = 0; void PopulateInterfaceProperty(const std::string&, diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 67697f8..48f92b0 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -455,10 +455,11 @@ cmExportInstallFileGenerator void cmExportInstallFileGenerator::HandleMissingTarget( std::string& link_libs, std::vector& missingTargets, - cmMakefile* mf, cmTarget* depender, cmTarget* dependee) + cmTarget* depender, cmTarget* dependee) { const std::string name = dependee->GetName(); - std::vector namespaces = this->FindNamespaces(mf, name); + cmGlobalGenerator* gg = dependee->GetMakefile()->GetGlobalGenerator(); + std::vector namespaces = this->FindNamespaces(gg, name); int targetOccurrences = (int)namespaces.size(); if (targetOccurrences == 1) { @@ -479,10 +480,9 @@ cmExportInstallFileGenerator::HandleMissingTarget( //---------------------------------------------------------------------------- std::vector cmExportInstallFileGenerator -::FindNamespaces(cmMakefile* mf, const std::string& name) +::FindNamespaces(cmGlobalGenerator* gg, const std::string& name) { std::vector namespaces; - cmGlobalGenerator* gg = mf->GetGlobalGenerator(); const cmExportSetMap& exportSets = gg->GetExportSets(); for(cmExportSetMap::const_iterator expIt = exportSets.begin(); diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h index b06fee5..b1fa70e 100644 --- a/Source/cmExportInstallFileGenerator.h +++ b/Source/cmExportInstallFileGenerator.h @@ -57,7 +57,6 @@ protected: std::vector &missingTargets); virtual void HandleMissingTarget(std::string& link_libs, std::vector& missingTargets, - cmMakefile* mf, cmTarget* depender, cmTarget* dependee); @@ -67,7 +66,7 @@ protected: cmTarget* dependee, int occurrences); - std::vector FindNamespaces(cmMakefile* mf, + std::vector FindNamespaces(cmGlobalGenerator* gg, const std::string& name); diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h index 19d8024..50c3187 100644 --- a/Source/cmExportTryCompileFileGenerator.h +++ b/Source/cmExportTryCompileFileGenerator.h @@ -37,7 +37,6 @@ protected: std::vector&) {} virtual void HandleMissingTarget(std::string&, std::vector&, - cmMakefile*, cmTarget*, cmTarget*) {} -- cgit v0.12