From 524bb1e36e75b3e2057ebaae1b9ca281dd2d1b57 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 4 Sep 2009 12:37:53 -0400 Subject: Simplify VS generator ZERO_CHECK dependency The VS generators use a ZERO_CHECK target on which all other targets depend to check whether CMake needs to re-run. This commit simplifies the addition of a dependency on the target to all other targets. We also move addition of dependencies to the beginning of the Generate step. This allows the dependency on ZERO_CHECK to be included in the global inter-target dependency analysis. --- Source/cmGlobalVisualStudio8Generator.cxx | 43 ++++++------------------------- Source/cmGlobalVisualStudio8Generator.h | 2 -- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 17a625d..cdb8f4e 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -242,46 +242,19 @@ void cmGlobalVisualStudio8Generator::Generate() } } - // Now perform the main generation. - this->cmGlobalVisualStudio7Generator::Generate(); -} - -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio8Generator::WriteSLNFile( - std::ostream& fout, cmLocalGenerator* root, - std::vector& generators) -{ - // Make all targets depend on their respective project's build - // system check target. - unsigned int i; - for(i = 0; i < generators.size(); ++i) + // All targets depend on the build-system check target. + for(std::map::const_iterator + ti = this->TotalTargets.begin(); + ti != this->TotalTargets.end(); ++ti) { - if(this->IsExcluded(root, generators[i])) + if(ti->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET) { - continue; - } - cmMakefile* mf = generators[i]->GetMakefile(); - cmTargets& tgts = mf->GetTargets(); - for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) - { - if(l->first == CMAKE_CHECK_BUILD_SYSTEM_TARGET) - { - for(unsigned int j = 0; j < generators.size(); ++j) - { - // Every target in all generators should depend on this target. - cmMakefile* lmf = generators[j]->GetMakefile(); - cmTargets &atgts = lmf->GetTargets(); - for(cmTargets::iterator al = atgts.begin(); al != atgts.end(); ++al) - { - al->second.AddUtility(l->first.c_str()); - } - } - } + ti->second->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET); } } - // Now write the solution file. - this->cmGlobalVisualStudio71Generator::WriteSLNFile(fout, root, generators); + // Now perform the main generation. + this->cmGlobalVisualStudio7Generator::Generate(); } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index cf5f5b6..74ee3c7 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -69,8 +69,6 @@ protected: static cmIDEFlagTable const* GetExtraFlagTableVS8(); virtual void AddPlatformDefinitions(cmMakefile* mf); - virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root, - std::vector& generators); virtual void WriteSLNHeader(std::ostream& fout); virtual void WriteSolutionConfigurations(std::ostream& fout); virtual void WriteProjectConfigurations(std::ostream& fout, -- cgit v0.12