diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2019-10-10 23:28:12 +1100 |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2019-10-12 17:01:15 +1100 |
commit | 5bf85e25178f5d9f19d2f30cf66f088c21e1114a (patch) | |
tree | dd22cbdaa84ef3faa5da98ced25adfed3219a507 /Source/cmMessageCommand.cxx | |
parent | aa59badd6f1ab3c40d3674c26e1e55271d25225c (diff) | |
download | cmake-5bf85e25178f5d9f19d2f30cf66f088c21e1114a.tar.gz |
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 15c007c07b..5fee5cac77 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; |