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

Method AddDisallowedCommand

Source/cmState.cxx:444–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444void cmState::AddDisallowedCommand(std::string const& name,
445 BuiltinCommand command,
446 cmPolicies::PolicyID policy,
447 char const* message,
448 char const* additionalWarning)
449{
450 this->AddBuiltinCommand(
451 name,
452 [command, policy, message,
453 additionalWarning](std::vector<cmListFileArgument> const& args,
454 cmExecutionStatus& status) -> bool {
455 cmMakefile& mf = status.GetMakefile();
456 switch (mf.GetPolicyStatus(policy)) {
457 case cmPolicies::WARN: {
458 std::string warning = cmPolicies::GetPolicyWarning(policy);
459 if (additionalWarning) {
460 warning = cmStrCat(warning, '\n', additionalWarning);
461 }
462 mf.IssueMessage(MessageType::AUTHOR_WARNING, warning);
463 }
464 CM_FALLTHROUGH;
465 case cmPolicies::OLD:
466 break;
467 case cmPolicies::NEW:
468 mf.IssueMessage(MessageType::FATAL_ERROR, message);
469 return true;
470 }
471 return InvokeBuiltinCommand(command, args, status);
472 });
473}
474
475void cmState::AddRemovedCommand(std::string const& name,
476 std::string const& message)

Callers 1

GetScriptingCommandsFunction · 0.80

Calls 6

AddBuiltinCommandMethod · 0.95
InvokeBuiltinCommandFunction · 0.85
cmStrCatFunction · 0.70
GetMakefileMethod · 0.45
GetPolicyStatusMethod · 0.45
IssueMessageMethod · 0.45

Tested by

no test coverage detected