|
@@ -2,18 +2,17 @@
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
|
|
#include "cmUnsetCommand.h"
|
|
#include "cmUnsetCommand.h"
|
|
|
|
|
|
|
|
|
|
+#include "cmExecutionStatus.h"
|
|
|
#include "cmMakefile.h"
|
|
#include "cmMakefile.h"
|
|
|
#include "cmStringAlgorithms.h"
|
|
#include "cmStringAlgorithms.h"
|
|
|
#include "cmSystemTools.h"
|
|
#include "cmSystemTools.h"
|
|
|
|
|
|
|
|
-class cmExecutionStatus;
|
|
|
|
|
-
|
|
|
|
|
// cmUnsetCommand
|
|
// cmUnsetCommand
|
|
|
-bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
|
|
|
|
|
- cmExecutionStatus&)
|
|
|
|
|
|
|
+bool cmUnsetCommand(std::vector<std::string> const& args,
|
|
|
|
|
+ cmExecutionStatus& status)
|
|
|
{
|
|
{
|
|
|
if (args.empty() || args.size() > 2) {
|
|
if (args.empty() || args.size() > 2) {
|
|
|
- this->SetError("called with incorrect number of arguments");
|
|
|
|
|
|
|
+ status.SetError("called with incorrect number of arguments");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -31,20 +30,20 @@ bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
|
|
|
}
|
|
}
|
|
|
// unset(VAR)
|
|
// unset(VAR)
|
|
|
if (args.size() == 1) {
|
|
if (args.size() == 1) {
|
|
|
- this->Makefile->RemoveDefinition(variable);
|
|
|
|
|
|
|
+ status.GetMakefile().RemoveDefinition(variable);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
// unset(VAR CACHE)
|
|
// unset(VAR CACHE)
|
|
|
if ((args.size() == 2) && (args[1] == "CACHE")) {
|
|
if ((args.size() == 2) && (args[1] == "CACHE")) {
|
|
|
- this->Makefile->RemoveCacheDefinition(variable);
|
|
|
|
|
|
|
+ status.GetMakefile().RemoveCacheDefinition(variable);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
// unset(VAR PARENT_SCOPE)
|
|
// unset(VAR PARENT_SCOPE)
|
|
|
if ((args.size() == 2) && (args[1] == "PARENT_SCOPE")) {
|
|
if ((args.size() == 2) && (args[1] == "PARENT_SCOPE")) {
|
|
|
- this->Makefile->RaiseScope(variable, nullptr);
|
|
|
|
|
|
|
+ status.GetMakefile().RaiseScope(variable, nullptr);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
// ERROR: second argument isn't CACHE or PARENT_SCOPE
|
|
// ERROR: second argument isn't CACHE or PARENT_SCOPE
|
|
|
- this->SetError("called with an invalid second argument");
|
|
|
|
|
|
|
+ status.SetError("called with an invalid second argument");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|