summaryrefslogtreecommitdiffstats
path: root/Source/cmCommands.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-10-22 20:50:42 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-10-22 21:04:31 (GMT)
commit8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b (patch)
tree3854ce6ac00cc25aa55905af070f2b91d0569504 /Source/cmCommands.cxx
parent3a82ff6a11d643c4a5959f65ea538a3b60784a16 (diff)
downloadCMake-8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b.zip
CMake-8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b.tar.gz
CMake-8aee7fdb32a7099e3e4efdf1bf0a00732ee1c46b.tar.bz2
cmState: Prohibit override of flow control commands
Diffstat (limited to 'Source/cmCommands.cxx')
-rw-r--r--Source/cmCommands.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 37be542..9e5b783 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -119,12 +119,19 @@
void GetScriptingCommands(cmState* state)
{
- state->AddBuiltinCommand("break", cmBreakCommand);
+ state->AddFlowControlCommand("break", cmBreakCommand);
+ state->AddFlowControlCommand("continue", cmContinueCommand);
+ state->AddFlowControlCommand("foreach", cmForEachCommand);
+ state->AddFlowControlCommand("function", cmFunctionCommand);
+ state->AddFlowControlCommand("if", cmIfCommand);
+ state->AddFlowControlCommand("macro", cmMacroCommand);
+ state->AddFlowControlCommand("return", cmReturnCommand);
+ state->AddFlowControlCommand("while", cmWhileCommand);
+
state->AddBuiltinCommand("cmake_minimum_required", cmCMakeMinimumRequired);
state->AddBuiltinCommand("cmake_path", cmCMakePathCommand);
state->AddBuiltinCommand("cmake_policy", cmCMakePolicyCommand);
state->AddBuiltinCommand("configure_file", cmConfigureFileCommand);
- state->AddBuiltinCommand("continue", cmContinueCommand);
state->AddBuiltinCommand("exec_program", cmExecProgramCommand);
state->AddBuiltinCommand("execute_process", cmExecuteProcessCommand);
state->AddBuiltinCommand("file", cmFileCommand);
@@ -133,26 +140,21 @@ void GetScriptingCommands(cmState* state)
state->AddBuiltinCommand("find_package", cmFindPackage);
state->AddBuiltinCommand("find_path", cmFindPath);
state->AddBuiltinCommand("find_program", cmFindProgram);
- state->AddBuiltinCommand("foreach", cmForEachCommand);
- state->AddBuiltinCommand("function", cmFunctionCommand);
state->AddBuiltinCommand("get_cmake_property", cmGetCMakePropertyCommand);
state->AddBuiltinCommand("get_directory_property",
cmGetDirectoryPropertyCommand);
state->AddBuiltinCommand("get_filename_component",
cmGetFilenameComponentCommand);
state->AddBuiltinCommand("get_property", cmGetPropertyCommand);
- state->AddBuiltinCommand("if", cmIfCommand);
state->AddBuiltinCommand("include", cmIncludeCommand);
state->AddBuiltinCommand("include_guard", cmIncludeGuardCommand);
state->AddBuiltinCommand("list", cmListCommand);
- state->AddBuiltinCommand("macro", cmMacroCommand);
state->AddBuiltinCommand("make_directory", cmMakeDirectoryCommand);
state->AddBuiltinCommand("mark_as_advanced", cmMarkAsAdvancedCommand);
state->AddBuiltinCommand("math", cmMathCommand);
state->AddBuiltinCommand("message", cmMessageCommand);
state->AddBuiltinCommand("option", cmOptionCommand);
state->AddBuiltinCommand("cmake_parse_arguments", cmParseArgumentsCommand);
- state->AddBuiltinCommand("return", cmReturnCommand);
state->AddBuiltinCommand("separate_arguments", cmSeparateArgumentsCommand);
state->AddBuiltinCommand("set", cmSetCommand);
state->AddBuiltinCommand("set_directory_properties",
@@ -161,7 +163,6 @@ void GetScriptingCommands(cmState* state)
state->AddBuiltinCommand("site_name", cmSiteNameCommand);
state->AddBuiltinCommand("string", cmStringCommand);
state->AddBuiltinCommand("unset", cmUnsetCommand);
- state->AddBuiltinCommand("while", cmWhileCommand);
state->AddUnexpectedCommand(
"else",