MCPcopy Create free account
hub / github.com/Kitware/CMake / cmReturnCommand

Function cmReturnCommand

Source/cmReturnCommand.cxx:16–47  ·  view source on GitHub ↗

cmReturnCommand

Source from the content-addressed store, hash-verified

14
15// cmReturnCommand
16bool 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}

Callers

nothing calls this directly

Calls 9

SetReturnInvokedMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45
GetPolicyStatusMethod · 0.45
GetMakefileMethod · 0.45
IssueMessageMethod · 0.45
SetErrorMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…