| 63 | namespace { |
| 64 | |
| 65 | bool HandleSetMode(std::vector<std::string> const& args, |
| 66 | cmExecutionStatus& status) |
| 67 | { |
| 68 | if (args.size() != 3) { |
| 69 | status.SetError("SET must be given exactly 2 additional arguments."); |
| 70 | return false; |
| 71 | } |
| 72 | |
| 73 | cmPolicies::PolicyStatus policyStatus; |
| 74 | if (args[2] == "OLD") { |
| 75 | policyStatus = cmPolicies::OLD; |
| 76 | } else if (args[2] == "NEW") { |
| 77 | policyStatus = cmPolicies::NEW; |
| 78 | } else { |
| 79 | status.SetError( |
| 80 | cmStrCat("SET given unrecognized policy status \"", args[2], '"')); |
| 81 | return false; |
| 82 | } |
| 83 | |
| 84 | if (!status.GetMakefile().SetPolicy(args[1].c_str(), policyStatus)) { |
| 85 | status.SetError("SET failed to set policy."); |
| 86 | return false; |
| 87 | } |
| 88 | return true; |
| 89 | } |
| 90 | |
| 91 | bool HandleGetMode(std::vector<std::string> const& args, |
| 92 | cmExecutionStatus& status) |
no test coverage detected
searching dependent graphs…