diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmake.cxx | 11 | ||||
-rw-r--r-- | Source/cmakemain.cxx | 5 |
2 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 02606c2..50f47af 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -725,7 +725,18 @@ void cmake::SetArgs(const std::vector<std::string>& args) } else if (arg.find("--debug-output", 0) == 0) { std::cout << "Running with debug output on.\n"; this->SetDebugOutputOn(true); + } else if (arg.find("--log-level=", 0) == 0) { + const auto logLevel = + StringToLogLevel(arg.substr(sizeof("--log-level=") - 1)); + if (logLevel == LogLevel::LOG_UNDEFINED) { + cmSystemTools::Error("Invalid level specified for --log-level"); + return; + } + this->SetLogLevel(logLevel); } else if (arg.find("--loglevel=", 0) == 0) { + // This is supported for backward compatibility. This option only + // appeared in the 3.15.x release series and was renamed to + // --log-level in 3.16.0 const auto logLevel = StringToLogLevel(arg.substr(sizeof("--loglevel=") - 1)); if (logLevel == LogLevel::LOG_UNDEFINED) { diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index cc00c81..6d3e6ee 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -70,8 +70,9 @@ const char* cmDocumentationOptions[][2] = { "Generate graphviz of dependencies, see " "CMakeGraphVizOptions.cmake for more." }, { "--system-information [file]", "Dump information about this system." }, - { "--loglevel=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>", - "Set the verbosity of messages from CMake files." }, + { "--log-level=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>", + "Set the verbosity of messages from CMake files. " + "--loglevel is also accepted for backward compatibility reasons." }, { "--debug-trycompile", "Do not delete the try_compile build tree. Only " "useful on one try_compile at a time." }, |