diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index fe6b44644..b224f09b3 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -833,6 +833,24 @@ const char* cmGeneratorTarget::GetLocation(const std::string& config) const return location.c_str(); } +std::vector const& +cmGeneratorTarget::GetPreBuildCommands() const +{ + return this->Target->GetPreBuildCommands(); +} + +std::vector const& +cmGeneratorTarget::GetPreLinkCommands() const +{ + return this->Target->GetPreLinkCommands(); +} + +std::vector const& +cmGeneratorTarget::GetPostBuildCommands() const +{ + return this->Target->GetPostBuildCommands(); +} + bool cmGeneratorTarget::IsImported() const { return this->Target->IsImported(); @@ -2267,11 +2285,11 @@ cmTargetTraceDependencies // Queue pre-build, pre-link, and post-build rule dependencies. this->CheckCustomCommands( - this->GeneratorTarget->Target->GetPreBuildCommands()); + this->GeneratorTarget->GetPreBuildCommands()); this->CheckCustomCommands( - this->GeneratorTarget->Target->GetPreLinkCommands()); + this->GeneratorTarget->GetPreLinkCommands()); this->CheckCustomCommands( - this->GeneratorTarget->Target->GetPostBuildCommands()); + this->GeneratorTarget->GetPostBuildCommands()); } //---------------------------------------------------------------------------- diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 544cf0eaf..2b2dc860c 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -33,6 +33,10 @@ public: bool IsImported() const; const char *GetLocation(const std::string& config) const; + std::vector const &GetPreBuildCommands() const; + std::vector const &GetPreLinkCommands() const; + std::vector const &GetPostBuildCommands() const; + #define DECLARE_TARGET_POLICY(POLICY) \ cmPolicies::PolicyStatus GetPolicyStatus ## POLICY () const \ { return this->PolicyMap.Get(cmPolicies::POLICY); } diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 12115be34..18e140e40 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -392,10 +392,10 @@ void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries() void cmGhsMultiTargetGenerator::WriteCustomCommands() { WriteCustomCommandsHelper( - this->GeneratorTarget->Target->GetPreBuildCommands(), + this->GeneratorTarget->GetPreBuildCommands(), cmTarget::PRE_BUILD); WriteCustomCommandsHelper( - this->GeneratorTarget->Target->GetPostBuildCommands(), + this->GeneratorTarget->GetPostBuildCommands(), cmTarget::POST_BUILD); } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index eecc82bb4..e6af94fbd 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1469,11 +1469,11 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases, cmGeneratorTarget* gtgt) { std::vector const & prebuild - = gtgt->Target->GetPreBuildCommands(); + = gtgt->GetPreBuildCommands(); std::vector const & prelink - = gtgt->Target->GetPreLinkCommands(); + = gtgt->GetPreLinkCommands(); std::vector postbuild - = gtgt->Target->GetPostBuildCommands(); + = gtgt->GetPostBuildCommands(); if(gtgt->GetType() == cmState::SHARED_LIBRARY && !gtgt->IsFrameworkOnApple()) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 34a50a3f6..541257b1a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1787,15 +1787,15 @@ void cmLocalUnixMakefileGenerator3 // Global targets store their rules in pre- and post-build commands. this->AppendCustomDepends(depends, - gt->Target->GetPreBuildCommands()); + gt->GetPreBuildCommands()); this->AppendCustomDepends(depends, - gt->Target->GetPostBuildCommands()); + gt->GetPostBuildCommands()); this->AppendCustomCommands(commands, - gt->Target->GetPreBuildCommands(), + gt->GetPreBuildCommands(), gt, cmLocalGenerator::START_OUTPUT); this->AppendCustomCommands(commands, - gt->Target->GetPostBuildCommands(), + gt->GetPostBuildCommands(), gt, cmLocalGenerator::START_OUTPUT); std::string targetName = gt->GetName(); diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index d5abf68f7..3b25edab1 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -266,21 +266,21 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, // depend only on the previous rule. if ((target->GetType() == cmState::UTILITY || target->GetType() == cmState::GLOBAL_TARGET) && - (!target->Target->GetPreBuildCommands().empty() || - !target->Target->GetPostBuildCommands().empty())) + (!target->GetPreBuildCommands().empty() || + !target->GetPostBuildCommands().empty())) { // Accumulate the dependencies of all the commands. std::vector depends; for (std::vector::const_iterator cr = - target->Target->GetPreBuildCommands().begin(); - cr != target->Target->GetPreBuildCommands().end(); ++cr) + target->GetPreBuildCommands().begin(); + cr != target->GetPreBuildCommands().end(); ++cr) { depends.insert(depends.end(), cr->GetDepends().begin(), cr->GetDepends().end()); } for (std::vector::const_iterator cr = - target->Target->GetPostBuildCommands().begin(); - cr != target->Target->GetPostBuildCommands().end(); ++cr) + target->GetPostBuildCommands().begin(); + cr != target->GetPostBuildCommands().end(); ++cr) { depends.insert(depends.end(), cr->GetDepends().begin(), cr->GetDepends().end()); @@ -289,14 +289,14 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout, // Add the pre- and post-build commands in order. int count = 1; for (std::vector::const_iterator cr = - target->Target->GetPreBuildCommands().begin(); - cr != target->Target->GetPreBuildCommands().end(); ++cr) + target->GetPreBuildCommands().begin(); + cr != target->GetPreBuildCommands().end(); ++cr) { this->AddUtilityCommandHack(target, count++, depends, *cr); } for (std::vector::const_iterator cr = - target->Target->GetPostBuildCommands().begin(); - cr != target->Target->GetPostBuildCommands().end(); ++cr) + target->GetPostBuildCommands().begin(); + cr != target->GetPostBuildCommands().end(); ++cr) { this->AddUtilityCommandHack(target, count++, depends, *cr); } @@ -838,8 +838,8 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmGeneratorTarget *target, // Write the pre-build and pre-link together (VS6 does not support both). event.Start("PreLink"); - event.Write(target->Target->GetPreBuildCommands()); - event.Write(target->Target->GetPreLinkCommands()); + event.Write(target->GetPreBuildCommands()); + event.Write(target->GetPreLinkCommands()); cmsys::auto_ptr pcc( this->MaybeCreateImplibDir(target, configName, false)); if(pcc.get()) @@ -855,7 +855,7 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmGeneratorTarget *target, // Write the post-build rules. event.Start("PostBuild"); - event.Write(target->Target->GetPostBuildCommands()); + event.Write(target->GetPostBuildCommands()); event.Finish(); customRuleCode += "# End Special Build Tool\n"; diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index ca8d697c0..95a299d52 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -2021,7 +2021,7 @@ void cmLocalVisualStudio7Generator const char* tool = this->FortranProject? "VFPreBuildEventTool":"VCPreBuildEventTool"; event.Start(tool); - event.Write(target->Target->GetPreBuildCommands()); + event.Write(target->GetPreBuildCommands()); event.Finish(); // Add pre-link event. @@ -2035,7 +2035,7 @@ void cmLocalVisualStudio7Generator { addedPrelink = true; std::vector commands = - target->Target->GetPreLinkCommands(); + target->GetPreLinkCommands(); cmGlobalVisualStudioGenerator* gg = static_cast(this->GlobalGenerator); gg->AddSymbolExportCommand( @@ -2045,7 +2045,7 @@ void cmLocalVisualStudio7Generator } if (!addedPrelink) { - event.Write(target->Target->GetPreLinkCommands()); + event.Write(target->GetPreLinkCommands()); } cmsys::auto_ptr pcc( this->MaybeCreateImplibDir(target, @@ -2059,7 +2059,7 @@ void cmLocalVisualStudio7Generator // Add post-build event. tool = this->FortranProject? "VFPostBuildEventTool":"VCPostBuildEventTool"; event.Start(tool); - event.Write(target->Target->GetPostBuildCommands()); + event.Write(target->GetPostBuildCommands()); event.Finish(); } diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index f56037fdb..9e35e4c2b 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -279,11 +279,11 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) { this->LocalGenerator ->AppendCustomCommands(commands, - this->GeneratorTarget->Target->GetPreBuildCommands(), + this->GeneratorTarget->GetPreBuildCommands(), this->GeneratorTarget); this->LocalGenerator ->AppendCustomCommands(commands, - this->GeneratorTarget->Target->GetPreLinkCommands(), + this->GeneratorTarget->GetPreLinkCommands(), this->GeneratorTarget); } @@ -450,7 +450,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) { this->LocalGenerator-> AppendCustomCommands(commands, - this->GeneratorTarget->Target->GetPostBuildCommands(), + this->GeneratorTarget->GetPostBuildCommands(), this->GeneratorTarget); } diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 0a65641de..1923ea4fb 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -114,7 +114,7 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules() // Add post-build rules. this->LocalGenerator-> AppendCustomCommands(commands, - this->GeneratorTarget->Target->GetPostBuildCommands(), + this->GeneratorTarget->GetPostBuildCommands(), this->GeneratorTarget); // Depend on the object files. @@ -458,11 +458,11 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules { this->LocalGenerator ->AppendCustomCommands(commands, - this->GeneratorTarget->Target->GetPreBuildCommands(), + this->GeneratorTarget->GetPreBuildCommands(), this->GeneratorTarget); this->LocalGenerator ->AppendCustomCommands(commands, - this->GeneratorTarget->Target->GetPreLinkCommands(), + this->GeneratorTarget->GetPreLinkCommands(), this->GeneratorTarget); } @@ -814,7 +814,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules { this->LocalGenerator-> AppendCustomCommands(commands, - this->GeneratorTarget->Target->GetPostBuildCommands(), + this->GeneratorTarget->GetPostBuildCommands(), this->GeneratorTarget); } diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx index d35c3ae03..5b62cbf3b 100644 --- a/Source/cmMakefileUtilityTargetGenerator.cxx +++ b/Source/cmMakefileUtilityTargetGenerator.cxx @@ -67,20 +67,20 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles() // Utility targets store their rules in pre- and post-build commands. this->LocalGenerator->AppendCustomDepends - (depends, this->GeneratorTarget->Target->GetPreBuildCommands()); + (depends, this->GeneratorTarget->GetPreBuildCommands()); this->LocalGenerator->AppendCustomDepends - (depends, this->GeneratorTarget->Target->GetPostBuildCommands()); + (depends, this->GeneratorTarget->GetPostBuildCommands()); this->LocalGenerator->AppendCustomCommands - (commands, this->GeneratorTarget->Target->GetPreBuildCommands(), + (commands, this->GeneratorTarget->GetPreBuildCommands(), this->GeneratorTarget); // Depend on all custom command outputs for sources this->DriveCustomCommands(depends); this->LocalGenerator->AppendCustomCommands - (commands, this->GeneratorTarget->Target->GetPostBuildCommands(), + (commands, this->GeneratorTarget->GetPostBuildCommands(), this->GeneratorTarget); // Add dependencies on targets that must be built first. diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index b533d377d..17561b5ab 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -598,9 +598,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() } const std::vector *cmdLists[3] = { - >.Target->GetPreBuildCommands(), - >.Target->GetPreLinkCommands(), - >.Target->GetPostBuildCommands() + >.GetPreBuildCommands(), + >.GetPreLinkCommands(), + >.GetPostBuildCommands() }; std::vector preLinkCmdLines, postBuildCmdLines; diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index b2a5334fc..edc65f030 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -33,8 +33,8 @@ void cmNinjaUtilityTargetGenerator::Generate() cmNinjaDeps deps, outputs, util_outputs(1, utilCommandName); const std::vector *cmdLists[2] = { - &this->GetGeneratorTarget()->Target->GetPreBuildCommands(), - &this->GetGeneratorTarget()->Target->GetPostBuildCommands() + &this->GetGeneratorTarget()->GetPreBuildCommands(), + &this->GetGeneratorTarget()->GetPostBuildCommands() }; bool uses_terminal = false; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 9c9f5abea..541e5f6f1 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2814,7 +2814,7 @@ cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName) { addedPrelink = true; std::vector commands = - this->GeneratorTarget->Target->GetPreLinkCommands(); + this->GeneratorTarget->GetPreLinkCommands(); this->GlobalGenerator->AddSymbolExportCommand( this->GeneratorTarget, commands, configName); this->WriteEvent("PreLinkEvent", commands, configName); @@ -2823,12 +2823,12 @@ cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName) if (!addedPrelink) { this->WriteEvent("PreLinkEvent", - this->GeneratorTarget->Target->GetPreLinkCommands(), configName); + this->GeneratorTarget->GetPreLinkCommands(), configName); } this->WriteEvent("PreBuildEvent", - this->GeneratorTarget->Target->GetPreBuildCommands(), configName); + this->GeneratorTarget->GetPreBuildCommands(), configName); this->WriteEvent("PostBuildEvent", - this->GeneratorTarget->Target->GetPostBuildCommands(), configName); + this->GeneratorTarget->GetPostBuildCommands(), configName); } void cmVisualStudio10TargetGenerator::WriteEvent(