cmReturnCommand
| 14 | |
| 15 | // cmReturnCommand |
| 16 | bool cmReturnCommand(std::vector<std::string> const& args, |
| 17 | cmExecutionStatus& status) |
| 18 | { |
| 19 | if (!args.empty()) { |
| 20 | switch (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0140)) { |
| 21 | case cmPolicies::WARN: |
| 22 | status.GetMakefile().IssueMessage( |
| 23 | MessageType::AUTHOR_WARNING, |
| 24 | cmStrCat( |
| 25 | cmPolicies::GetPolicyWarning(cmPolicies::CMP0140), |
| 26 | "\n" |
| 27 | "return() checks its arguments when the policy is set to NEW. " |
| 28 | "Since the policy is not set the OLD behavior will be used so " |
| 29 | "the arguments will be ignored.")); |
| 30 | CM_FALLTHROUGH; |
| 31 | case cmPolicies::OLD: |
| 32 | return true; |
| 33 | default: |
| 34 | break; |
| 35 | } |
| 36 | if (args[0] != "PROPAGATE"_s) { |
| 37 | status.SetError( |
| 38 | cmStrCat("called with unsupported argument \"", args[0], '"')); |
| 39 | cmSystemTools::SetFatalErrorOccurred(); |
| 40 | return false; |
| 41 | } |
| 42 | status.SetReturnInvoked({ args.begin() + 1, args.end() }); |
| 43 | } else { |
| 44 | status.SetReturnInvoked(); |
| 45 | } |
| 46 | return true; |
| 47 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…