From 95b3bb5dbcb6021f07329f5bc400b1a205386970 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 20 Aug 2010 13:16:43 -0400 Subject: Restore GetTargetDirectDepends const return The returned set should never be modified. Restore 'const' correctness unnecessarily removed by commit 6903d2df (remove const, 2008-01-30). --- Source/cmGlobalGenerator.cxx | 4 ++-- Source/cmGlobalGenerator.h | 2 +- Source/cmVisualStudio10TargetGenerator.cxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index bd26b5f..fbc578b 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1487,7 +1487,7 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap() // Add dependencies of the included target. An excluded // target may still be included if it is a dependency of a // non-excluded target. - TargetDependSet & tgtdeps = this->GetTargetDirectDepends(target); + TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target); for(TargetDependSet::const_iterator ti = tgtdeps.begin(); ti != tgtdeps.end(); ++ti) { @@ -1879,7 +1879,7 @@ void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*, } //---------------------------------------------------------------------------- -cmGlobalGenerator::TargetDependSet & +cmGlobalGenerator::TargetDependSet const& cmGlobalGenerator::GetTargetDirectDepends(cmTarget & target) { return this->TargetDependencies[&target]; diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 878be11..9d5aa57 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -238,7 +238,7 @@ public: // what targets does the specified target depend on directly // via a target_link_libraries or add_dependencies - TargetDependSet & GetTargetDirectDepends(cmTarget & target); + TargetDependSet const& GetTargetDirectDepends(cmTarget & target); const std::map >& GetProjectMap() const {return this->ProjectMap;} diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 59e20d5..2af7036 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1413,7 +1413,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent( void cmVisualStudio10TargetGenerator::WriteProjectReferences() { - cmGlobalGenerator::TargetDependSet& depends + cmGlobalGenerator::TargetDependSet const& depends = this->GlobalGenerator->GetTargetDirectDepends(*this->Target); this->WriteString("\n", 1); for( cmGlobalGenerator::TargetDependSet::const_iterator i = depends.begin(); -- cgit v0.12