cmake: Fix constness of methods

This commit is contained in:
Stephen Kelly 2016-01-28 22:10:23 +01:00 committed by Daniel Pfeifer
parent 87ffd76d1a
commit 6e65808516
2 changed files with 15 additions and 14 deletions

View File

@ -2176,7 +2176,7 @@ static bool cmakeCheckStampList(const char* stampList)
return true; return true;
} }
cmake::MessageType cmake::ConvertMessageType(cmake::MessageType t) cmake::MessageType cmake::ConvertMessageType(cmake::MessageType t) const
{ {
bool warningsAsErrors; bool warningsAsErrors;
@ -2200,7 +2200,7 @@ cmake::MessageType cmake::ConvertMessageType(cmake::MessageType t)
return t; return t;
} }
bool cmake::IsMessageTypeVisible(cmake::MessageType t) bool cmake::IsMessageTypeVisible(cmake::MessageType t) const
{ {
bool isVisible = true; bool isVisible = true;
@ -2296,7 +2296,8 @@ void displayMessage(cmake::MessageType t, std::ostringstream& msg)
} }
void cmake::IssueMessage(cmake::MessageType t, std::string const& text, void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
cmListFileBacktrace const& backtrace, bool force) cmListFileBacktrace const& backtrace,
bool force) const
{ {
if (!force) { if (!force) {
// override the message type, if needed, for warnings and errors // override the message type, if needed, for warnings and errors
@ -2448,7 +2449,7 @@ void cmake::RunCheckForUnusedVariables()
#endif #endif
} }
bool cmake::GetSuppressDevWarnings(cmMakefile const* mf) bool cmake::GetSuppressDevWarnings(cmMakefile const* mf) const
{ {
/* /*
* The suppression CMake variable may be set in the CMake configuration file * The suppression CMake variable may be set in the CMake configuration file
@ -2482,7 +2483,7 @@ void cmake::SetSuppressDevWarnings(bool b)
cmState::INTERNAL); cmState::INTERNAL);
} }
bool cmake::GetSuppressDeprecatedWarnings(cmMakefile const* mf) bool cmake::GetSuppressDeprecatedWarnings(cmMakefile const* mf) const
{ {
/* /*
* The suppression CMake variable may be set in the CMake configuration file * The suppression CMake variable may be set in the CMake configuration file
@ -2517,7 +2518,7 @@ void cmake::SetSuppressDeprecatedWarnings(bool b)
cmState::INTERNAL); cmState::INTERNAL);
} }
bool cmake::GetDevWarningsAsErrors(cmMakefile const* mf) bool cmake::GetDevWarningsAsErrors(cmMakefile const* mf) const
{ {
if (mf) { if (mf) {
return (mf->IsSet("CMAKE_SUPPRESS_DEVELOPER_ERRORS") && return (mf->IsSet("CMAKE_SUPPRESS_DEVELOPER_ERRORS") &&
@ -2548,7 +2549,7 @@ void cmake::SetDevWarningsAsErrors(bool b)
cmState::INTERNAL); cmState::INTERNAL);
} }
bool cmake::GetDeprecatedWarningsAsErrors(cmMakefile const* mf) bool cmake::GetDeprecatedWarningsAsErrors(cmMakefile const* mf) const
{ {
if (mf) { if (mf) {
return mf->IsOn("CMAKE_ERROR_DEPRECATED"); return mf->IsOn("CMAKE_ERROR_DEPRECATED");

View File

@ -339,7 +339,7 @@ public:
* Returns false, by default, if developer warnings should be shown, true * Returns false, by default, if developer warnings should be shown, true
* otherwise. * otherwise.
*/ */
bool GetSuppressDevWarnings(cmMakefile const* mf = NULL); bool GetSuppressDevWarnings(cmMakefile const* mf = NULL) const;
/* /*
* Set the state of the suppression of developer (author) warnings. * Set the state of the suppression of developer (author) warnings.
*/ */
@ -350,7 +350,7 @@ public:
* Returns false, by default, if deprecated warnings should be shown, true * Returns false, by default, if deprecated warnings should be shown, true
* otherwise. * otherwise.
*/ */
bool GetSuppressDeprecatedWarnings(cmMakefile const* mf = NULL); bool GetSuppressDeprecatedWarnings(cmMakefile const* mf = NULL) const;
/* /*
* Set the state of the suppression of deprecated warnings. * Set the state of the suppression of deprecated warnings.
*/ */
@ -361,7 +361,7 @@ public:
* Returns false, by default, if warnings should not be treated as errors, * Returns false, by default, if warnings should not be treated as errors,
* true otherwise. * true otherwise.
*/ */
bool GetDevWarningsAsErrors(cmMakefile const* mf = NULL); bool GetDevWarningsAsErrors(cmMakefile const* mf = NULL) const;
/** /**
* Set the state of treating developer (author) warnings as errors. * Set the state of treating developer (author) warnings as errors.
*/ */
@ -372,7 +372,7 @@ public:
* Returns false, by default, if warnings should not be treated as errors, * Returns false, by default, if warnings should not be treated as errors,
* true otherwise. * true otherwise.
*/ */
bool GetDeprecatedWarningsAsErrors(cmMakefile const* mf = NULL); bool GetDeprecatedWarningsAsErrors(cmMakefile const* mf = NULL) const;
/** /**
* Set the state of treating developer (author) warnings as errors. * Set the state of treating developer (author) warnings as errors.
*/ */
@ -382,7 +382,7 @@ public:
void IssueMessage( void IssueMessage(
cmake::MessageType t, std::string const& text, cmake::MessageType t, std::string const& text,
cmListFileBacktrace const& backtrace = cmListFileBacktrace(), cmListFileBacktrace const& backtrace = cmListFileBacktrace(),
bool force = false); bool force = false) const;
///! run the --build option ///! run the --build option
int Build(const std::string& dir, const std::string& target, int Build(const std::string& dir, const std::string& target,
@ -493,13 +493,13 @@ private:
* Convert a message type between a warning and an error, based on the state * Convert a message type between a warning and an error, based on the state
* of the error output CMake variables, in the cache. * of the error output CMake variables, in the cache.
*/ */
cmake::MessageType ConvertMessageType(cmake::MessageType t); cmake::MessageType ConvertMessageType(cmake::MessageType t) const;
/* /*
* Check if messages of this type should be output, based on the state of the * Check if messages of this type should be output, based on the state of the
* warning and error output CMake variables, in the cache. * warning and error output CMake variables, in the cache.
*/ */
bool IsMessageTypeVisible(cmake::MessageType t); bool IsMessageTypeVisible(cmake::MessageType t) const;
}; };
#define CMAKE_STANDARD_OPTIONS_TABLE \ #define CMAKE_STANDARD_OPTIONS_TABLE \