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;
const std::vector<std::string>& outputs = ccg.GetOutputs();
if (!outputs.empty()) {
cmOutputConverter::RelativeRoot relative_root =
ccg.GetWorkingDirectory().empty() ? cmOutputConverter::START_OUTPUT
: cmOutputConverter::NONE;
output =
this->Convert(outputs[0], relative_root, cmOutputConverter::SHELL);
if (ccg.GetWorkingDirectory().empty()) {
output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
cmOutputConverter::SHELL);
} else {
output = this->Convert(outputs[0], cmOutputConverter::NONE,
cmOutputConverter::SHELL);
}
}
vars.Output = output.c_str();

View File

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