diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 42a35b25f4..bb6ffe7e2e 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -25,7 +25,7 @@ cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator(cmake* cm) void cmGlobalVisualStudio71Generator::WriteSLNFile( std::ostream& fout, cmLocalGenerator* root, - std::vector& generators) + OrderedTargetDependSet const& orderedProjectTargets) { std::vector configs = root->GetMakefile()->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); @@ -33,14 +33,6 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile( // Write out the header for a SLN file this->WriteSLNHeader(fout); - // Collect all targets under this root generator and the transitive - // closure of their dependencies. - TargetDependSet projectTargets; - TargetDependSet originalTargets; - this->GetTargetSets(projectTargets, originalTargets, root, generators); - OrderedTargetDependSet orderedProjectTargets( - projectTargets, this->GetStartupProjectName(root)); - // Generate the targets specification to a string. We will put this in // the actual .sln file later. As a side effect, this method also // populates the set of folders. diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 8b8e37ecc1..dac7caa596 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -28,8 +28,9 @@ public: cmGlobalVisualStudio71Generator(cmake* cm); protected: - void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, - std::vector& generators) override; + void WriteSLNFile( + std::ostream& fout, cmLocalGenerator* root, + OrderedTargetDependSet const& orderedProjectTargets) override; virtual void WriteSolutionConfigurations( std::ostream& fout, std::vector const& configs); void WriteProject(std::ostream& fout, std::string const& name, diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index b9343d4226..c7335815c3 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -316,13 +316,22 @@ void cmGlobalVisualStudio7Generator::OutputSLNFile( if (generators.empty()) { return; } + + // Collect all targets under this root generator and the transitive + // closure of their dependencies. + TargetDependSet projectTargets; + TargetDependSet originalTargets; + this->GetTargetSets(projectTargets, originalTargets, root, generators); + OrderedTargetDependSet orderedProjectTargets( + projectTargets, this->GetStartupProjectName(root)); + std::string fname = GetSLNFile(root); cmGeneratedFileStream fout(fname); fout.SetCopyIfDifferent(true); if (!fout) { return; } - this->WriteSLNFile(fout, root, generators); + this->WriteSLNFile(fout, root, orderedProjectTargets); if (fout.Close()) { this->FileReplacedDuringGenerate(fname); } diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 3b82d8e603..4a6da5332e 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -141,8 +141,9 @@ protected: virtual void OutputSLNFile(cmLocalGenerator* root, std::vector& generators); - virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, - std::vector& generators) = 0; + virtual void WriteSLNFile( + std::ostream& fout, cmLocalGenerator* root, + OrderedTargetDependSet const& orderedProjectTargets) = 0; virtual void WriteProject(std::ostream& fout, std::string const& name, std::string const& path, cmGeneratorTarget const* t) = 0;