Makefiles: Replace ternaries with if()s

This commit is contained in:
Stephen Kelly 2016-08-27 13:44:54 +02:00
parent 51f7dcb0a5
commit ee49f006cf
2 changed files with 15 additions and 10 deletions

View File

@ -486,12 +486,13 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
std::string output; std::string output;
const std::vector<std::string>& outputs = ccg.GetOutputs(); const std::vector<std::string>& outputs = ccg.GetOutputs();
if (!outputs.empty()) { if (!outputs.empty()) {
cmOutputConverter::RelativeRoot relative_root = if (ccg.GetWorkingDirectory().empty()) {
ccg.GetWorkingDirectory().empty() ? cmOutputConverter::START_OUTPUT output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
: cmOutputConverter::NONE; cmOutputConverter::SHELL);
} else {
output = output = this->Convert(outputs[0], cmOutputConverter::NONE,
this->Convert(outputs[0], relative_root, cmOutputConverter::SHELL); cmOutputConverter::SHELL);
}
} }
vars.Output = output.c_str(); vars.Output = output.c_str();

View File

@ -990,10 +990,14 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
std::string output; std::string output;
const std::vector<std::string>& outputs = ccg.GetOutputs(); const std::vector<std::string>& outputs = ccg.GetOutputs();
if (!outputs.empty()) { if (!outputs.empty()) {
output = this->Convert(outputs[0], workingDir.empty() if (workingDir.empty()) {
? cmOutputConverter::START_OUTPUT output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
: cmOutputConverter::NONE, cmOutputConverter::SHELL);
cmOutputConverter::SHELL);
} else {
output = this->Convert(outputs[0], cmOutputConverter::NONE,
cmOutputConverter::SHELL);
}
} }
vars.Output = output.c_str(); vars.Output = output.c_str();