summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-10 16:36:24 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-10 16:36:24 (GMT)
commita16bf141bc5d393b27d13d8235d95a1b034052c2 (patch)
tree59ecd625114f6e98065e7901f418a28fc540cd45 /Source/cmGlobalNinjaGenerator.cxx
parentbd9e551c1a13f566e6ffe8cdd1262b7628ed5330 (diff)
downloadCMake-a16bf141bc5d393b27d13d8235d95a1b034052c2.zip
CMake-a16bf141bc5d393b27d13d8235d95a1b034052c2.tar.gz
CMake-a16bf141bc5d393b27d13d8235d95a1b034052c2.tar.bz2
Add missing braces around statements.
Apply fixits of clang-tidy's readability-braces-around-statements checker.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx27
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 3abcba3..f74e835 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -30,8 +30,9 @@ const char* cmGlobalNinjaGenerator::INDENT = " ";
void cmGlobalNinjaGenerator::Indent(std::ostream& os, int count)
{
- for (int i = 0; i < count; ++i)
+ for (int i = 0; i < count; ++i) {
os << cmGlobalNinjaGenerator::INDENT;
+ }
}
void cmGlobalNinjaGenerator::WriteDivider(std::ostream& os)
@@ -43,8 +44,9 @@ void cmGlobalNinjaGenerator::WriteDivider(std::ostream& os)
void cmGlobalNinjaGenerator::WriteComment(std::ostream& os,
const std::string& comment)
{
- if (comment.empty())
+ if (comment.empty()) {
return;
+ }
std::string::size_type lpos = 0;
std::string::size_type rpos;
@@ -165,16 +167,18 @@ void cmGlobalNinjaGenerator::WriteBuild(
if (!implicitDeps.empty()) {
arguments += " |";
for (cmNinjaDeps::const_iterator i = implicitDeps.begin();
- i != implicitDeps.end(); ++i)
+ i != implicitDeps.end(); ++i) {
arguments += " " + EncodeIdent(EncodePath(*i), os);
+ }
}
// Write order-only dependencies.
if (!orderOnlyDeps.empty()) {
arguments += " ||";
for (cmNinjaDeps::const_iterator i = orderOnlyDeps.begin();
- i != orderOnlyDeps.end(); ++i)
+ i != orderOnlyDeps.end(); ++i) {
arguments += " " + EncodeIdent(EncodePath(*i), os);
+ }
}
arguments += "\n";
@@ -198,9 +202,10 @@ void cmGlobalNinjaGenerator::WriteBuild(
// Write the variables bound to this build statement.
std::ostringstream variable_assignments;
for (cmNinjaVars::const_iterator i = variables.begin(); i != variables.end();
- ++i)
+ ++i) {
cmGlobalNinjaGenerator::WriteVariable(variable_assignments, i->first,
i->second, "", 1);
+ }
// check if a response file rule should be used
std::string buildstr = build;
@@ -430,8 +435,9 @@ void cmGlobalNinjaGenerator::WriteDefault(std::ostream& os,
cmGlobalNinjaGenerator::WriteComment(os, comment);
os << "default";
for (cmNinjaDeps::const_iterator i = targets.begin(); i != targets.end();
- ++i)
+ ++i) {
os << " " << *i;
+ }
os << "\n";
}
@@ -907,15 +913,17 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias,
this->AppendTargetOutputs(target, outputs);
// Mark the target's outputs as ambiguous to ensure that no other target uses
// the output as an alias.
- for (cmNinjaDeps::iterator i = outputs.begin(); i != outputs.end(); ++i)
+ for (cmNinjaDeps::iterator i = outputs.begin(); i != outputs.end(); ++i) {
TargetAliases[*i] = 0;
+ }
// Insert the alias into the map. If the alias was already present in the
// map and referred to another target, mark it as ambiguous.
std::pair<TargetAliasMap::iterator, bool> newAlias =
TargetAliases.insert(std::make_pair(buildAlias, target));
- if (newAlias.second && newAlias.first->second != target)
+ if (newAlias.second && newAlias.first->second != target) {
newAlias.first->second = 0;
+ }
}
void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
@@ -926,8 +934,9 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
for (TargetAliasMap::const_iterator i = TargetAliases.begin();
i != TargetAliases.end(); ++i) {
// Don't write ambiguous aliases.
- if (!i->second)
+ if (!i->second) {
continue;
+ }
cmNinjaDeps deps;
this->AppendTargetOutputs(i->second, deps);