diff options
author | Michael Scott <michael.scott250@gmail.com> | 2015-12-21 21:39:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-01-12 19:02:51 (GMT) |
commit | 28f2d750edaf6ee1af660d3a0ae6792c65c47997 (patch) | |
tree | 3e22c760e48a58d34c9e337c9ffef0f6295f0ebe /Source/cmMessageCommand.cxx | |
parent | b5009720d3020021f189570d72c099963795a5c5 (diff) | |
download | CMake-28f2d750edaf6ee1af660d3a0ae6792c65c47997.zip CMake-28f2d750edaf6ee1af660d3a0ae6792c65c47997.tar.gz CMake-28f2d750edaf6ee1af660d3a0ae6792c65c47997.tar.bz2 |
Add -Werror and -Wno-error command-line options
Expand the -W set of cmake options to include support for the -Werror
and -Wno-error format, which is used to control upgrading and
downgrading warning and error messages. Implement support for these new
formats for the dev and deprecated message types.
Add tests and updated documentation for new options.
Diffstat (limited to 'Source/cmMessageCommand.cxx')
-rw-r--r-- | Source/cmMessageCommand.cxx | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 8272eb0..1c67cea 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -25,6 +25,7 @@ bool cmMessageCommand cmake::MessageType type = cmake::MESSAGE; bool status = false; bool fatal = false; + cmake* cm = this->Makefile->GetCMakeInstance(); if (*i == "SEND_ERROR") { type = cmake::FATAL_ERROR; @@ -43,15 +44,19 @@ bool cmMessageCommand } else if (*i == "AUTHOR_WARNING") { - if (this->Makefile->GetCMakeInstance()->GetSuppressDevWarnings( - this->Makefile)) + if (cm->GetDevWarningsAsErrors(this->Makefile)) { - return true; + fatal = true; + type = cmake::AUTHOR_ERROR; } - else + else if (!cm->GetSuppressDevWarnings(this->Makefile)) { type = cmake::AUTHOR_WARNING; } + else + { + return true; + } ++i; } else if (*i == "STATUS") @@ -61,22 +66,18 @@ bool cmMessageCommand } else if (*i == "DEPRECATION") { - if (this->Makefile->IsOn("CMAKE_ERROR_DEPRECATED")) + if (cm->GetDeprecatedWarningsAsErrors(this->Makefile)) { fatal = true; type = cmake::DEPRECATION_ERROR; } + else if (!cm->GetSuppressDeprecatedWarnings(this->Makefile)) + { + type = cmake::DEPRECATION_WARNING; + } else { - if (this->Makefile->GetCMakeInstance()->GetSuppressDeprecatedWarnings( - this->Makefile)) - { - return true; - } - else - { - type = cmake::DEPRECATION_WARNING; - } + return true; } ++i; } |