Makefiles: Replace ternaries with if()s
This commit is contained in:
parent
51f7dcb0a5
commit
ee49f006cf
|
@ -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();
|
||||
|
||||
|
|
|
@ -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,
|
||||
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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue