mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-01 04:03:24 +03:00
cmake: Do not treat developer warnings as errors by default in scripts
The logic in commit c96fe0b4 (cmake: Add -W options to control
deprecation warnings and errors, 2015-07-28) accidentally enables
errors on warnings by default in scripts because there is no
initialization of CMAKE_SUPPRESS_DEVELOPER_ERRORS to TRUE.
Rename internal CMAKE_SUPPRESS_DEVELOPER_ERRORS cache entry to
CMAKE_ERROR_DEVELOPER_WARNINGS. Fix the logic in the message() command
to treat AUTHOR_WARNING as an error only if the option is explicitly
enabled.
This commit is contained in:
1 parent
c96fe0b40d
commit
975426ceb3
2 files changed
+6
-6
No files matched your search
@@ -43,7 +43,7 @@ bool cmMessageCommand
|
|||||||
}
|
}
|
||||||
else if (*i == "AUTHOR_WARNING")
|
else if (*i == "AUTHOR_WARNING")
|
||||||
{
|
{
|
||||||
if (!this->Makefile->IsOn("CMAKE_SUPPRESS_DEVELOPER_ERRORS"))
|
if (this->Makefile->IsOn("CMAKE_ERROR_DEVELOPER_WARNINGS"))
|
||||||
{
|
{
|
||||||
fatal = true;
|
fatal = true;
|
||||||
type = cmake::AUTHOR_ERROR;
|
type = cmake::AUTHOR_ERROR;
|
||||||
|
|||||||
+5
-5
@@ -1289,7 +1289,7 @@ int cmake::Configure()
|
|||||||
" the author of the CMakeLists.txt files.",
|
" the author of the CMakeLists.txt files.",
|
||||||
cmState::INTERNAL);
|
cmState::INTERNAL);
|
||||||
this->CacheManager->
|
this->CacheManager->
|
||||||
AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_ERRORS", "TRUE",
|
AddCacheEntry("CMAKE_ERROR_DEVELOPER_WARNINGS", "FALSE",
|
||||||
"Suppress errors that are meant for"
|
"Suppress errors that are meant for"
|
||||||
" the author of the CMakeLists.txt files.",
|
" the author of the CMakeLists.txt files.",
|
||||||
cmState::INTERNAL);
|
cmState::INTERNAL);
|
||||||
@@ -1328,7 +1328,7 @@ int cmake::Configure()
|
|||||||
else if (warningLevel == ERROR_LEVEL)
|
else if (warningLevel == ERROR_LEVEL)
|
||||||
{
|
{
|
||||||
this->CacheManager->
|
this->CacheManager->
|
||||||
AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_ERRORS", "FALSE",
|
AddCacheEntry("CMAKE_ERROR_DEVELOPER_WARNINGS", "TRUE",
|
||||||
"Suppress errors that are meant for"
|
"Suppress errors that are meant for"
|
||||||
" the author of the CMakeLists.txt files.",
|
" the author of the CMakeLists.txt files.",
|
||||||
cmState::INTERNAL);
|
cmState::INTERNAL);
|
||||||
@@ -1676,11 +1676,11 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// don't turn dev warnings into errors by default, if no value has been
|
// don't turn dev warnings into errors by default, if no value has been
|
||||||
// specified for the flag, enable it
|
// specified for the flag, disable it
|
||||||
if (!this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS"))
|
if (!this->State->GetCacheEntryValue("CMAKE_ERROR_DEVELOPER_WARNINGS"))
|
||||||
{
|
{
|
||||||
this->CacheManager->
|
this->CacheManager->
|
||||||
AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_ERRORS", "TRUE",
|
AddCacheEntry("CMAKE_ERROR_DEVELOPER_WARNINGS", "FALSE",
|
||||||
"Suppress errors that are meant for"
|
"Suppress errors that are meant for"
|
||||||
" the author of the CMakeLists.txt files.",
|
" the author of the CMakeLists.txt files.",
|
||||||
cmState::INTERNAL);
|
cmState::INTERNAL);
|
||||||
|
|||||||
Reference in new issue
Block a user