diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-10-18 21:20:47 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-24 07:19:53 (GMT) |
commit | 4bc65d76f13c63367857b22e87f73baa8e6d5970 (patch) | |
tree | ccb74d4d3de185413ccd9846bdfd4687de13ebe8 /Source | |
parent | 80de856bb5cba20d424b91e4a49fe8fdb1f904a3 (diff) | |
download | CMake-4bc65d76f13c63367857b22e87f73baa8e6d5970.zip CMake-4bc65d76f13c63367857b22e87f73baa8e6d5970.tar.gz CMake-4bc65d76f13c63367857b22e87f73baa8e6d5970.tar.bz2 |
Makefiles: Port to cmGeneratorTarget.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCommonTargetGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmCommonTargetGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 13 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.h | 2 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 11 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.h | 13 | ||||
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 16 | ||||
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 19 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmMakefileUtilityTargetGenerator.cxx | 11 |
11 files changed, 48 insertions, 48 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 2c47ab2..bd47715 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -18,7 +18,6 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmSystemTools.h" -#include "cmTarget.h" cmCommonTargetGenerator::cmCommonTargetGenerator( cmOutputConverter::RelativeRoot wd, @@ -26,7 +25,6 @@ cmCommonTargetGenerator::cmCommonTargetGenerator( ) : WorkingDirectory(wd) , GeneratorTarget(gt) - , Target(gt->Target) , Makefile(gt->Makefile) , LocalGenerator(static_cast<cmLocalCommonGenerator*>(gt->LocalGenerator)) , GlobalGenerator(static_cast<cmGlobalCommonGenerator*>( diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index a4b2c10..3fb1fd0 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -21,7 +21,6 @@ class cmGlobalCommonGenerator; class cmLocalCommonGenerator; class cmMakefile; class cmSourceFile; -class cmTarget; /** \class cmCommonTargetGenerator * \brief Common infrastructure for Makefile and Ninja per-target generators @@ -49,7 +48,6 @@ protected: cmOutputConverter::RelativeRoot WorkingDirectory; cmGeneratorTarget* GeneratorTarget; - cmTarget* Target; cmMakefile* Makefile; cmLocalCommonGenerator* LocalGenerator; cmGlobalCommonGenerator* GlobalGenerator; diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 4d7ca25..b4a915c 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -16,7 +16,6 @@ #include "cmake.h" #include "cmGeneratedFileStream.h" #include "cmSourceFile.h" -#include "cmTarget.h" #include "cmGeneratorTarget.h" #include "cmAlgorithms.h" @@ -742,7 +741,7 @@ cmGlobalUnixMakefileGenerator3 makefileName = localName; makefileName += "/build.make"; - bool needRequiresStep = this->NeedRequiresStep(*gtarget->Target); + bool needRequiresStep = this->NeedRequiresStep(gtarget); lg->WriteDivider(ruleFileStream); ruleFileStream @@ -1129,19 +1128,19 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule bool cmGlobalUnixMakefileGenerator3 -::NeedRequiresStep(cmTarget const& target) +::NeedRequiresStep(const cmGeneratorTarget* target) { std::set<std::string> languages; - cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&target); - gtgt->GetLanguages(languages, - target.GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE")); + target->GetLanguages(languages, + target->Target->GetMakefile() + ->GetSafeDefinition("CMAKE_BUILD_TYPE")); for(std::set<std::string>::const_iterator l = languages.begin(); l != languages.end(); ++l) { std::string var = "CMAKE_NEEDS_REQUIRES_STEP_"; var += *l; var += "_FLAG"; - if(target.GetMakefile()->GetDefinition(var)) + if(target->Target->GetMakefile()->GetDefinition(var)) { return true; } diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 0485eb8..63ffcb4 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -154,7 +154,7 @@ protected: cmGeneratorTarget* target); // does this generator need a requires step for any of its targets - bool NeedRequiresStep(cmTarget const&); + bool NeedRequiresStep(cmGeneratorTarget const*); // Target name hooks for superclass. const char* GetAllTargetName() const { return "all"; } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index e9dc9ff..34a50a3 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1977,7 +1977,7 @@ void cmLocalUnixMakefileGenerator3 cmGeneratorTarget* target) { ImplicitDependLanguageMap const& implicitLangs = - this->GetImplicitDepends(*target->Target); + this->GetImplicitDepends(target); // list the languages cmakefileStream @@ -2292,19 +2292,20 @@ cmLocalUnixMakefileGenerator3 //---------------------------------------------------------------------------- cmLocalUnixMakefileGenerator3::ImplicitDependLanguageMap const& -cmLocalUnixMakefileGenerator3::GetImplicitDepends(cmTarget const& tgt) +cmLocalUnixMakefileGenerator3::GetImplicitDepends( + const cmGeneratorTarget* tgt) { - return this->ImplicitDepends[tgt.GetName()]; + return this->ImplicitDepends[tgt->GetName()]; } //---------------------------------------------------------------------------- void -cmLocalUnixMakefileGenerator3::AddImplicitDepends(cmTarget const& tgt, +cmLocalUnixMakefileGenerator3::AddImplicitDepends(const cmGeneratorTarget* tgt, const std::string& lang, const char* obj, const char* src) { - this->ImplicitDepends[tgt.GetName()][lang][obj].push_back(src); + this->ImplicitDepends[tgt->GetName()][lang][obj].push_back(src); } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 7e0f248..8f69311 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -21,7 +21,6 @@ class cmCustomCommand; class cmCustomCommandGenerator; class cmDepends; class cmMakefileTargetGenerator; -class cmTarget; class cmSourceFile; /** \class cmLocalUnixMakefileGenerator3 @@ -141,9 +140,11 @@ public: public std::map<std::string, ImplicitDependFileMap> {}; struct ImplicitDependTargetMap: public std::map<std::string, ImplicitDependLanguageMap> {}; - ImplicitDependLanguageMap const& GetImplicitDepends(cmTarget const& tgt); + ImplicitDependLanguageMap const& + GetImplicitDepends(cmGeneratorTarget const* tgt); - void AddImplicitDepends(cmTarget const& tgt, const std::string& lang, + void AddImplicitDepends(cmGeneratorTarget const* tgt, + const std::string& lang, const char* obj, const char* src); // write the target rules for the local Makefile into the stream @@ -197,12 +198,12 @@ protected: const std::string& helpTarget); void WriteTargetDependRule(std::ostream& ruleFileStream, - cmTarget& target); + cmGeneratorTarget* target); void WriteTargetCleanRule(std::ostream& ruleFileStream, - cmTarget& target, + cmGeneratorTarget* target, const std::vector<std::string>& files); void WriteTargetRequiresRule(std::ostream& ruleFileStream, - cmTarget& target, + cmGeneratorTarget* target, const std::vector<std::string>& objects); void AppendRuleDepend(std::vector<std::string>& depends, diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 020e64c..f56037f 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -16,7 +16,6 @@ #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmSourceFile.h" -#include "cmTarget.h" #include "cmake.h" //---------------------------------------------------------------------------- @@ -279,11 +278,13 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) if(!relink) { this->LocalGenerator - ->AppendCustomCommands(commands, this->Target->GetPreBuildCommands(), - this->GeneratorTarget); + ->AppendCustomCommands(commands, + this->GeneratorTarget->Target->GetPreBuildCommands(), + this->GeneratorTarget); this->LocalGenerator - ->AppendCustomCommands(commands, this->Target->GetPreLinkCommands(), - this->GeneratorTarget); + ->AppendCustomCommands(commands, + this->GeneratorTarget->Target->GetPreLinkCommands(), + this->GeneratorTarget); } // Determine whether a link script will be used. @@ -448,8 +449,9 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) if(!relink) { this->LocalGenerator-> - AppendCustomCommands(commands, this->Target->GetPostBuildCommands(), - this->GeneratorTarget); + AppendCustomCommands(commands, + this->GeneratorTarget->Target->GetPostBuildCommands(), + this->GeneratorTarget); } // Write the build rule. diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index df2a8c9..0a65641 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -16,7 +16,6 @@ #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmSourceFile.h" -#include "cmTarget.h" #include "cmake.h" #include "cmAlgorithms.h" @@ -114,7 +113,8 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules() // Add post-build rules. this->LocalGenerator-> - AppendCustomCommands(commands, this->Target->GetPostBuildCommands(), + AppendCustomCommands(commands, + this->GeneratorTarget->Target->GetPostBuildCommands(), this->GeneratorTarget); // Depend on the object files. @@ -457,11 +457,13 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules if(!relink) { this->LocalGenerator - ->AppendCustomCommands(commands, this->Target->GetPreBuildCommands(), - this->GeneratorTarget); + ->AppendCustomCommands(commands, + this->GeneratorTarget->Target->GetPreBuildCommands(), + this->GeneratorTarget); this->LocalGenerator - ->AppendCustomCommands(commands, this->Target->GetPreLinkCommands(), - this->GeneratorTarget); + ->AppendCustomCommands(commands, + this->GeneratorTarget->Target->GetPreLinkCommands(), + this->GeneratorTarget); } // Determine whether a link script will be used. @@ -811,8 +813,9 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules if(!relink) { this->LocalGenerator-> - AppendCustomCommands(commands, this->Target->GetPostBuildCommands(), - this->GeneratorTarget); + AppendCustomCommands(commands, + this->GeneratorTarget->Target->GetPostBuildCommands(), + this->GeneratorTarget); } // Compute the list of outputs. diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index b7970fd..7acccb3 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -18,7 +18,6 @@ #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmSourceFile.h" -#include "cmTarget.h" #include "cmake.h" #include "cmState.h" #include "cmComputeLinkInformation.h" @@ -432,7 +431,7 @@ void cmMakefileTargetGenerator std::string srcFullPath = this->Convert(source.GetFullPath(), cmLocalGenerator::FULL); this->LocalGenerator-> - AddImplicitDepends(*this->Target, lang, + AddImplicitDepends(this->GeneratorTarget, lang, objFullPath.c_str(), srcFullPath.c_str()); } @@ -1241,7 +1240,7 @@ void cmMakefileTargetGenerator std::string srcFullPath = this->Convert(idi->second, cmLocalGenerator::FULL); this->LocalGenerator-> - AddImplicitDepends(*this->Target, idi->first, + AddImplicitDepends(this->GeneratorTarget, idi->first, objFullPath.c_str(), srcFullPath.c_str()); } diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index e38c50b..38f40c0 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -24,7 +24,6 @@ class cmGeneratedFileStream; class cmGlobalUnixMakefileGenerator3; class cmLocalUnixMakefileGenerator3; class cmMakefile; -class cmTarget; class cmSourceFile; /** \class cmMakefileTargetGenerator @@ -51,7 +50,6 @@ public: std::string GetProgressFileNameFull() { return this->ProgressFileNameFull; } - cmTarget* GetTarget() { return this->Target;} cmGeneratorTarget* GetGeneratorTarget() { return this->GeneratorTarget;} protected: diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index 11601c5..d35c3ae 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -16,7 +16,6 @@ #include "cmLocalUnixMakefileGenerator3.h" #include "cmMakefile.h" #include "cmSourceFile.h" -#include "cmTarget.h" //---------------------------------------------------------------------------- cmMakefileUtilityTargetGenerator @@ -68,19 +67,21 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles() // Utility targets store their rules in pre- and post-build commands. this->LocalGenerator->AppendCustomDepends - (depends, this->Target->GetPreBuildCommands()); + (depends, this->GeneratorTarget->Target->GetPreBuildCommands()); this->LocalGenerator->AppendCustomDepends - (depends, this->Target->GetPostBuildCommands()); + (depends, this->GeneratorTarget->Target->GetPostBuildCommands()); this->LocalGenerator->AppendCustomCommands - (commands, this->Target->GetPreBuildCommands(), this->GeneratorTarget); + (commands, this->GeneratorTarget->Target->GetPreBuildCommands(), + this->GeneratorTarget); // Depend on all custom command outputs for sources this->DriveCustomCommands(depends); this->LocalGenerator->AppendCustomCommands - (commands, this->Target->GetPostBuildCommands(), this->GeneratorTarget); + (commands, this->GeneratorTarget->Target->GetPostBuildCommands(), + this->GeneratorTarget); // Add dependencies on targets that must be built first. this->AppendTargetDepends(depends); |