diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2019-10-10 12:28:12 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2019-10-12 06:01:15 (GMT) |
commit | 5bf85e25178f5d9f19d2f30cf66f088c21e1114a (patch) | |
tree | dd22cbdaa84ef3faa5da98ced25adfed3219a507 /Source/cmMessageCommand.cxx | |
parent | aa59badd6f1ab3c40d3674c26e1e55271d25225c (diff) | |
download | CMake-5bf85e25178f5d9f19d2f30cf66f088c21e1114a.zip CMake-5bf85e25178f5d9f19d2f30cf66f088c21e1114a.tar.gz CMake-5bf85e25178f5d9f19d2f30cf66f088c21e1114a.tar.bz2 |
message: Add new CMAKE_MESSAGE_LOG_LEVEL variable
Diffstat (limited to 'Source/cmMessageCommand.cxx')
-rw-r--r-- | Source/cmMessageCommand.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 15c007c..5fee5ca 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -95,6 +95,15 @@ bool cmMessageCommand(std::vector<std::string> const& args, assert("Expected a valid log level here" && desiredLevel != cmake::LogLevel::LOG_UNDEFINED); + // Command line option takes precedence over the cache variable + if (!mf.GetCMakeInstance()->WasLogLevelSetViaCLI()) { + const auto desiredLevelFromCache = + cmake::StringToLogLevel(mf.GetSafeDefinition("CMAKE_MESSAGE_LOG_LEVEL")); + if (desiredLevelFromCache != cmake::LogLevel::LOG_UNDEFINED) { + desiredLevel = desiredLevelFromCache; + } + } + if (desiredLevel < level) { // Suppress the message return true; |