diff options
author | Brad King <brad.king@kitware.com> | 2015-10-06 14:59:00 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-10-06 14:59:00 (GMT) |
commit | c914d2bda278b588c1dca3e0fa5ec97a64c56c3c (patch) | |
tree | e10024eaa740ad8edfe5918d2c1e06f72c4523de /Source | |
parent | 9d5bfa53e63c894b1c774258882877f57d61638f (diff) | |
parent | 616f03114eb41218dc3278e72b52d8de09e40365 (diff) | |
download | CMake-c914d2bda278b588c1dca3e0fa5ec97a64c56c3c.zip CMake-c914d2bda278b588c1dca3e0fa5ec97a64c56c3c.tar.gz CMake-c914d2bda278b588c1dca3e0fa5ec97a64c56c3c.tar.bz2 |
Merge topic 'refactor-computation'
616f0311 cmGlobalGenerator: Move path computation to Compute.
9eea0486 cmGlobalGenerator: Do more computation at compute time.
2eca0559 cmGlobalGenerator: De-virtualize Compute().
21f428f4 VisualStudio: Replace Compute override with AddExtraIDETargets override.
a9588e90 VisualStudio10: Initialize the LongestSource at generate time.
4407eee0 cmGlobalGenerator: Call AddExtraIDETargets as a hook of Compute().
a09c545d Xcode: Extract a AddExtraIDETargets method.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 26 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 12 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 9 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 9 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.h | 2 |
10 files changed, 23 insertions, 52 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 309884f..05f1029 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1282,12 +1282,7 @@ bool cmGlobalGenerator::Compute() } } - return true; -} - -void cmGlobalGenerator::Generate() -{ - unsigned int i; + this->AddExtraIDETargets(); // Trace the dependencies, after that no custom commands should be added // because their dependencies might not be handled correctly @@ -1307,22 +1302,27 @@ void cmGlobalGenerator::Generate() // Compute the inter-target dependencies. if(!this->ComputeTargetDepends()) { - return; + return false; + } + + for (i = 0; i < this->LocalGenerators.size(); ++i) + { + this->LocalGenerators[i]->ComputeHomeRelativeOutputPath(); } + return true; +} + +void cmGlobalGenerator::Generate() +{ // Create a map from local generator to the complete set of targets // it builds by default. this->InitializeProgressMarks(); this->ProcessEvaluationFiles(); - for (i = 0; i < this->LocalGenerators.size(); ++i) - { - this->LocalGenerators[i]->ComputeHomeRelativeOutputPath(); - } - // Generate project files - for (i = 0; i < this->LocalGenerators.size(); ++i) + for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { this->SetCurrentMakefile(this->LocalGenerators[i]->GetMakefile()); this->LocalGenerators[i]->Generate(); diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 25e06cd..b22c695 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -83,7 +83,8 @@ public: */ virtual void Configure(); - virtual bool Compute(); + bool Compute(); + virtual void AddExtraIDETargets() {} enum TargetTypes { AllTargets, diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 59e8f8c..161b532 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -325,19 +325,9 @@ cmLocalGenerator* cmGlobalVisualStudio10Generator::CreateLocalGenerator( return new cmLocalVisualStudio10Generator(this, mf); } -//---------------------------------------------------------------------------- -bool cmGlobalVisualStudio10Generator::Compute() -{ - if (!cmGlobalVisualStudio8Generator::Compute()) - { - return false; - } - this->LongestSource = LongestSourcePath(); - return true; -} - void cmGlobalVisualStudio10Generator::Generate() { + this->LongestSource = LongestSourcePath(); this->cmGlobalVisualStudio8Generator::Generate(); if(this->LongestSource.Length > 0) { diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index f4861dc..7600a0d 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -45,8 +45,6 @@ public: std::vector<std::string> const& makeOptions = std::vector<std::string>() ); - virtual bool Compute(); - ///! create the correct local generator virtual cmLocalGenerator *CreateLocalGenerator(cmMakefile* mf); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 70c00e9..86a8f87 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -348,13 +348,9 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() } //---------------------------------------------------------------------------- -bool cmGlobalVisualStudio8Generator::Compute() +void cmGlobalVisualStudio8Generator::AddExtraIDETargets() { - if (!cmGlobalVisualStudio7Generator::Compute()) - { - return false; - } - + cmGlobalVisualStudio7Generator::AddExtraIDETargets(); if(this->AddCheckTarget()) { // All targets depend on the build-system check target. @@ -368,7 +364,6 @@ bool cmGlobalVisualStudio8Generator::Compute() } } } - return true; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 1c61103..9d6c64f 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -67,7 +67,7 @@ public: return !this->WindowsCEVersion.empty(); } protected: - virtual bool Compute(); + virtual void AddExtraIDETargets(); virtual const char* GetIDEVersion() { return "8.0"; } virtual std::string FindDevEnvCommand(); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 7552d67..d45aa27 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -64,13 +64,8 @@ std::string cmGlobalVisualStudioGenerator::GetRegistryBase( } //---------------------------------------------------------------------------- -bool cmGlobalVisualStudioGenerator::Compute() +void cmGlobalVisualStudioGenerator::AddExtraIDETargets() { - if (!cmGlobalGenerator::Compute()) - { - return false; - } - // Add a special target that depends on ALL projects for easy build // of one configuration only. const char* no_working_dir = 0; @@ -144,7 +139,6 @@ bool cmGlobalVisualStudioGenerator::Compute() static_cast<cmLocalVisualStudioGenerator*>(*lgi); lg->AddCMakeListsRules(); } - return true; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index c940eb3..41d0b88 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -111,7 +111,7 @@ public: cmGeneratorTarget*, std::vector<cmCustomCommand>& commands, std::string const& configName); protected: - virtual bool Compute(); + virtual void AddExtraIDETargets(); // Does this VS version link targets to each other if there are // dependencies in the SLN file? This was done for VS versions diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 33babec..746e1a7 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -376,14 +376,8 @@ cmGlobalXCodeGenerator::CreateLocalGenerator(cmMakefile* mf) return new cmLocalXCodeGenerator(this, mf); } -//---------------------------------------------------------------------------- -bool cmGlobalXCodeGenerator::Compute() +void cmGlobalXCodeGenerator::AddExtraIDETargets() { - if (!cmGlobalGenerator::Compute()) - { - return false; - } - std::map<std::string, std::vector<cmLocalGenerator*> >::iterator it; // make sure extra targets are added before calling // the parent generate which will call trace depends @@ -394,7 +388,6 @@ bool cmGlobalXCodeGenerator::Compute() // add ALL_BUILD, INSTALL, etc this->AddExtraTargets(root, it->second); } - return true; } void cmGlobalXCodeGenerator::Generate() diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 102c036..9daf0ab 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -87,7 +87,7 @@ public: virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf); void AppendFlag(std::string& flags, std::string const& flag); protected: - virtual bool Compute(); + virtual void AddExtraIDETargets(); virtual void Generate(); private: cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget, |