diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-22 20:50:42 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-22 21:04:31 (GMT) |
commit | 8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b (patch) | |
tree | 3854ce6ac00cc25aa55905af070f2b91d0569504 /Source/cmLoadCommandCommand.cxx | |
parent | 3a82ff6a11d643c4a5959f65ea538a3b60784a16 (diff) | |
download | CMake-8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b.zip CMake-8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b.tar.gz CMake-8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b.tar.bz2 |
cmState: Prohibit override of flow control commands
Diffstat (limited to 'Source/cmLoadCommandCommand.cxx')
-rw-r--r-- | Source/cmLoadCommandCommand.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 5790e16..adebe02 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -24,6 +24,7 @@ #include "cmCommand.h" #include "cmDynamicLoader.h" #include "cmExecutionStatus.h" +#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmState.h" @@ -36,8 +37,6 @@ # include <malloc.h> /* for malloc/free on QNX */ #endif -class cmListFileBacktrace; - namespace { const char* LastName = nullptr; @@ -256,10 +255,12 @@ bool cmLoadCommandCommand(std::vector<std::string> const& args, // if the symbol is found call it to set the name on the // function blocker if (initFunction) { - status.GetMakefile().GetState()->AddScriptedCommand( + return status.GetMakefile().GetState()->AddScriptedCommand( args[0], - cmLegacyCommandWrapper(cm::make_unique<cmLoadedCommand>(initFunction))); - return true; + BT<cmState::Command>( + cmLegacyCommandWrapper(cm::make_unique<cmLoadedCommand>(initFunction)), + status.GetMakefile().GetBacktrace()), + status.GetMakefile()); } status.SetError("Attempt to load command failed. " "No init function found."); |