cmake/Source/cmMessenger.h

62 lines
1.6 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef cmMessenger_h
#define cmMessenger_h
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
2020-02-01 23:06:01 +01:00
#include <string>
2016-10-30 18:24:19 +01:00
#include "cmListFileCache.h"
2019-11-11 23:01:05 +01:00
#include "cmMessageType.h"
2016-10-30 18:24:19 +01:00
class cmMessenger
{
public:
void IssueMessage(
2019-11-11 23:01:05 +01:00
MessageType t, std::string const& text,
2016-10-30 18:24:19 +01:00
cmListFileBacktrace const& backtrace = cmListFileBacktrace()) const;
2019-11-11 23:01:05 +01:00
void DisplayMessage(MessageType t, std::string const& text,
2016-10-30 18:24:19 +01:00
cmListFileBacktrace const& backtrace) const;
2019-11-11 23:01:05 +01:00
void SetSuppressDevWarnings(bool suppress)
{
this->SuppressDevWarnings = suppress;
}
void SetSuppressDeprecatedWarnings(bool suppress)
{
this->SuppressDeprecatedWarnings = suppress;
}
void SetDevWarningsAsErrors(bool error)
{
this->DevWarningsAsErrors = error;
}
void SetDeprecatedWarningsAsErrors(bool error)
{
this->DeprecatedWarningsAsErrors = error;
}
bool GetSuppressDevWarnings() const { return this->SuppressDevWarnings; }
bool GetSuppressDeprecatedWarnings() const
{
return this->SuppressDeprecatedWarnings;
}
bool GetDevWarningsAsErrors() const { return this->DevWarningsAsErrors; }
bool GetDeprecatedWarningsAsErrors() const
{
return this->DeprecatedWarningsAsErrors;
}
2016-10-30 18:24:19 +01:00
private:
2019-11-11 23:01:05 +01:00
bool IsMessageTypeVisible(MessageType t) const;
MessageType ConvertMessageType(MessageType t) const;
2016-10-30 18:24:19 +01:00
2019-11-11 23:01:05 +01:00
bool SuppressDevWarnings = false;
bool SuppressDeprecatedWarnings = false;
bool DevWarningsAsErrors = false;
bool DeprecatedWarningsAsErrors = false;
2016-10-30 18:24:19 +01:00
};
#endif