mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
@@ -291,8 +291,7 @@ void GetProjectCommands(cmState* state)
|
||||
cm::make_unique<cmLoadCacheCommand>());
|
||||
state->AddBuiltinCommand("qt_wrap_cpp", cmQTWrapCPPCommand);
|
||||
state->AddBuiltinCommand("qt_wrap_ui", cmQTWrapUICommand);
|
||||
state->AddBuiltinCommand("remove_definitions",
|
||||
cm::make_unique<cmRemoveDefinitionsCommand>());
|
||||
state->AddBuiltinCommand("remove_definitions", cmRemoveDefinitionsCommand);
|
||||
state->AddBuiltinCommand("source_group",
|
||||
cm::make_unique<cmSourceGroupCommand>());
|
||||
|
||||
|
||||
@@ -2,21 +2,15 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#include "cmRemoveDefinitionsCommand.h"
|
||||
|
||||
#include "cmExecutionStatus.h"
|
||||
#include "cmMakefile.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
|
||||
// cmRemoveDefinitionsCommand
|
||||
bool cmRemoveDefinitionsCommand::InitialPass(
|
||||
std::vector<std::string> const& args, cmExecutionStatus&)
|
||||
bool cmRemoveDefinitionsCommand(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status)
|
||||
{
|
||||
// it is OK to have no arguments
|
||||
if (args.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
cmMakefile& mf = status.GetMakefile();
|
||||
for (std::string const& i : args) {
|
||||
this->Makefile->RemoveDefineFlag(i);
|
||||
mf.RemoveDefineFlag(i);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8,36 +8,9 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cm_memory.hxx"
|
||||
|
||||
#include "cmCommand.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
|
||||
/** \class cmRemoveDefinitionsCommand
|
||||
* \brief Specify a list of compiler defines
|
||||
*
|
||||
* cmRemoveDefinitionsCommand specifies a list of compiler defines.
|
||||
* These defines will
|
||||
* be removed from the compile command.
|
||||
*/
|
||||
class cmRemoveDefinitionsCommand : public cmCommand
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* This is a virtual constructor for the command.
|
||||
*/
|
||||
std::unique_ptr<cmCommand> Clone() override
|
||||
{
|
||||
return cm::make_unique<cmRemoveDefinitionsCommand>();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called when the command is first encountered in
|
||||
* the CMakeLists.txt file.
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) override;
|
||||
};
|
||||
bool cmRemoveDefinitionsCommand(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user