|
|
@@ -450,6 +450,17 @@ std::string cmake::ReportCapabilities() const
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+cmake::CommandFailureAction cmake::GetCommandFailureAction() const
|
|
|
+{
|
|
|
+ switch (this->State->GetRole()) {
|
|
|
+ case cmState::Role::Project:
|
|
|
+ case cmState::Role::CTest:
|
|
|
+ return CommandFailureAction::EXIT_CODE;
|
|
|
+ default:
|
|
|
+ return CommandFailureAction::FATAL_ERROR;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void cmake::CleanupCommandsAndMacros()
|
|
|
{
|
|
|
this->CurrentSnapshot = this->State->Reset();
|
|
|
@@ -665,8 +676,7 @@ bool cmake::SetCacheArgs(std::vector<std::string> const& args)
|
|
|
GetProjectCommandsInScriptMode(state->GetState());
|
|
|
// Documented behavior of CMAKE{,_CURRENT}_{SOURCE,BINARY}_DIR is to be
|
|
|
// set to $PWD for -P mode.
|
|
|
- state->SetWorkingMode(SCRIPT_MODE,
|
|
|
- cmake::CommandFailureAction::FATAL_ERROR);
|
|
|
+ state->SetWorkingMode(SCRIPT_MODE);
|
|
|
state->SetHomeDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
state->SetHomeOutputDirectory(cmSystemTools::GetLogicalWorkingDirectory());
|
|
|
state->ReadListFile(args, path);
|
|
|
@@ -1572,8 +1582,7 @@ void cmake::SetArgs(std::vector<std::string> const& args)
|
|
|
presetsGraph.PrintAllPresets();
|
|
|
}
|
|
|
|
|
|
- this->SetWorkingMode(WorkingMode::HELP_MODE,
|
|
|
- cmake::CommandFailureAction::FATAL_ERROR);
|
|
|
+ this->SetWorkingMode(WorkingMode::HELP_MODE);
|
|
|
return;
|
|
|
}
|
|
|
|