From ac800f49d07337df79565c77fe0847222ade520b Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 13 Mar 2012 09:17:46 -0400 Subject: [PATCH] Ninja: Constify use of cmCustomCommand The generator never needs to modify custom command instances. --- Source/cmGlobalNinjaGenerator.h | 4 ++-- Source/cmLocalNinjaGenerator.cxx | 6 +++--- Source/cmLocalNinjaGenerator.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index e77252f12..39df826cf 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -270,7 +270,7 @@ private: /// Called when we have seen the given custom command. Returns true /// if we has seen it before. - bool SeenCustomCommand(cmCustomCommand *cc) { + bool SeenCustomCommand(cmCustomCommand const *cc) { return !this->CustomCommands.insert(cc).second; } @@ -315,7 +315,7 @@ private: cmNinjaDeps AllDependencies; /// The set of custom commands we have seen. - std::set CustomCommands; + std::set CustomCommands; /// The set of custom command outputs we have seen. std::set CustomCommandOutputs; diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index ea03cbb2e..78072b51f 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -343,8 +343,8 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(const cmCustomCommand *cc, } void -cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(cmCustomCommand *cc, - const cmNinjaDeps& orderOnlyDeps) +cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( + cmCustomCommand const *cc, const cmNinjaDeps& orderOnlyDeps) { if (this->GetGlobalNinjaGenerator()->SeenCustomCommand(cc)) return; @@ -383,7 +383,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(cmCustomCommand *cc, } } -void cmLocalNinjaGenerator::AddCustomCommandTarget(cmCustomCommand* cc, +void cmLocalNinjaGenerator::AddCustomCommandTarget(cmCustomCommand const* cc, cmTarget* target) { this->CustomCommandTargets[cc].insert(target); diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index e9bbf4301..28b431d6e 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -118,17 +118,17 @@ private: void AppendCustomCommandLines(const cmCustomCommand *cc, std::vector &cmdLines); void WriteCustomCommandRule(); - void WriteCustomCommandBuildStatement(cmCustomCommand *cc, + void WriteCustomCommandBuildStatement(cmCustomCommand const *cc, const cmNinjaDeps& orderOnlyDeps); - void AddCustomCommandTarget(cmCustomCommand* cc, cmTarget* target); + void AddCustomCommandTarget(cmCustomCommand const* cc, cmTarget* target); void WriteCustomCommandBuildStatements(); private: std::string ConfigName; std::string HomeRelativeOutputPath; - typedef std::map > + typedef std::map > CustomCommandTargetMap; CustomCommandTargetMap CustomCommandTargets; };