Commit ac800f49 authored by Brad King's avatar Brad King
Browse files

Ninja: Constify use of cmCustomCommand

The generator never needs to modify custom command instances.
parent 9a0d5a82
......@@ -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<cmCustomCommand *> CustomCommands;
std::set<cmCustomCommand const*> CustomCommands;
/// The set of custom command outputs we have seen.
std::set<std::string> CustomCommandOutputs;
......
......@@ -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);
......
......@@ -118,17 +118,17 @@ private:
void AppendCustomCommandLines(const cmCustomCommand *cc,
std::vector<std::string> &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<cmCustomCommand*, std::set<cmTarget*> >
typedef std::map<cmCustomCommand const*, std::set<cmTarget*> >
CustomCommandTargetMap;
CustomCommandTargetMap CustomCommandTargets;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment