diff options
author | Brad King <brad.king@kitware.com> | 2013-10-18 12:41:54 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-22 09:09:52 -0400 |
commit | aa76518f8bfd821f000d1779066eb7614cdd079b (patch) | |
tree | 4005fa79df546cbf0de9bfb2f0610b27a9b65c3d /Source | |
parent | 97268cf5b7626febb06d04c2201ace397a4863fd (diff) | |
download | cmake-aa76518f8bfd821f000d1779066eb7614cdd079b.tar.gz |
Add policy CMP0031 to disallow load_command
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLoadCommandCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmLoadCommandCommand.h | 24 | ||||
-rw-r--r-- | Source/cmPolicies.cxx | 5 | ||||
-rw-r--r-- | Source/cmPolicies.h | 1 |
4 files changed, 11 insertions, 22 deletions
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 84dd299e45..21ee0fe45c 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -189,6 +189,9 @@ cmLoadedCommand::~cmLoadedCommand() bool cmLoadCommandCommand ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &) { + if(this->Disallowed(cmPolicies::CMP0031, + "The load_command command should not be called; see CMP0031.")) + { return true; } if(args.size() < 1 ) { return true; diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h index 918f32b035..11bcf097de 100644 --- a/Source/cmLoadCommandCommand.h +++ b/Source/cmLoadCommandCommand.h @@ -14,34 +14,14 @@ #include "cmCommand.h" -/** \class cmLoadCommandCommand - * \brief Load in a Command plugin - * - * cmLoadCommandCommand loads a command into CMake - */ class cmLoadCommandCommand : public cmCommand { public: - /** - * This is a virtual constructor for the command. - */ - virtual cmCommand* Clone() - { - return new cmLoadCommandCommand; - } - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ + virtual cmCommand* Clone() { return new cmLoadCommandCommand; } virtual bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus &status); - - /** - * The name of the command as specified in CMakeList.txt. - */ virtual const char* GetName() const {return "load_command";} - + virtual bool IsDiscouraged() const { return true; } cmTypeMacro(cmLoadCommandCommand, cmCommand); }; diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index fdd3bd0188..03e898ee12 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -256,6 +256,11 @@ cmPolicies::cmPolicies() CMP0030, "CMP0030", "The use_mangled_mesa command should not be called.", 3,0,0,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0031, "CMP0031", + "The load_command command should not be called.", + 3,0,0,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 6de168e654..597296bfdc 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -82,6 +82,7 @@ public: CMP0028, ///< Double colon in target name means ALIAS or IMPORTED target. CMP0029, ///< Disallow command: subdir_depends CMP0030, ///< Disallow command: use_mangled_mesa + CMP0031, ///< Disallow command: load_command /** \brief Always the last entry. * |