summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-08-27 11:44:54 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-08-27 13:21:23 (GMT)
commite804d410cd4e391cd81ff3d8981cfba1fae28742 (patch)
tree29360b72889fc8f795ecccf84f9d2a72e0fb5d7d /Source/cmLocalUnixMakefileGenerator3.cxx
parent2722c4dcc55605b7946f3c9bfa4b2fe5ce4161cb (diff)
downloadCMake-e804d410cd4e391cd81ff3d8981cfba1fae28742.zip
CMake-e804d410cd4e391cd81ff3d8981cfba1fae28742.tar.gz
CMake-e804d410cd4e391cd81ff3d8981cfba1fae28742.tar.bz2
Makefiles: Invert logic in MakeLauncher
Make it easier to inline into the caller.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx39
1 files changed, 19 insertions, 20 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index e148887..47b891f 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1034,28 +1034,27 @@ std::string cmLocalUnixMakefileGenerator3::MakeLauncher(
// Short-circuit if there is no launcher.
const char* prop = "RULE_LAUNCH_CUSTOM";
const char* val = this->GetRuleLauncher(target, prop);
- if (!(val && *val)) {
- return "";
- }
-
- // Expand rules in the empty string. It may insert the launcher and
- // perform replacements.
- RuleVariables vars;
- vars.RuleLauncher = prop;
- vars.CMTarget = target;
- std::string output;
- const std::vector<std::string>& outputs = ccg.GetOutputs();
- if (!outputs.empty()) {
- output = this->Convert(outputs[0], relative, cmOutputConverter::SHELL);
- }
- vars.Output = output.c_str();
+ if (val && *val) {
+ // Expand rules in the empty string. It may insert the launcher and
+ // perform replacements.
+ RuleVariables vars;
+ vars.RuleLauncher = prop;
+ vars.CMTarget = target;
+ std::string output;
+ const std::vector<std::string>& outputs = ccg.GetOutputs();
+ if (!outputs.empty()) {
+ output = this->Convert(outputs[0], relative, cmOutputConverter::SHELL);
+ }
+ vars.Output = output.c_str();
- std::string launcher;
- this->ExpandRuleVariables(launcher, vars);
- if (!launcher.empty()) {
- launcher += " ";
+ std::string launcher;
+ this->ExpandRuleVariables(launcher, vars);
+ if (!launcher.empty()) {
+ launcher += " ";
+ }
+ return launcher;
}
- return launcher;
+ return "";
}
void cmLocalUnixMakefileGenerator3::AppendCleanCommand(