ENH: make sure -Wno-dev sticks so make rebuild_cache will work

This commit is contained in:
Bill Hoffman 2008-03-22 10:24:06 -04:00
parent 73b3110eb5
commit 6d0845f2f8
2 changed files with 22 additions and 16 deletions

View File

@ -141,6 +141,7 @@ void cmNeedBackwardsCompatibility(const std::string& variable,
cmake::cmake() cmake::cmake()
{ {
this->SuppressDevWarnings = false; this->SuppressDevWarnings = false;
this->DoSuppressDevWarnings = false;
this->DebugOutput = false; this->DebugOutput = false;
this->DebugTryCompile = false; this->DebugTryCompile = false;
this->ClearBuildSystem = false; this->ClearBuildSystem = false;
@ -387,10 +388,12 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
else if(arg.find("-Wno-dev",0) == 0) else if(arg.find("-Wno-dev",0) == 0)
{ {
this->SuppressDevWarnings = true; this->SuppressDevWarnings = true;
this->DoSuppressDevWarnings = true;
} }
else if(arg.find("-Wdev",0) == 0) else if(arg.find("-Wdev",0) == 0)
{ {
this->SuppressDevWarnings = false; this->SuppressDevWarnings = false;
this->DoSuppressDevWarnings = true;
} }
else if(arg.find("-U",0) == 0) else if(arg.find("-U",0) == 0)
{ {
@ -1896,23 +1899,25 @@ int cmake::HandleDeleteCacheVariables(const char* var)
int cmake::Configure() int cmake::Configure()
{ {
if(this->SuppressDevWarnings) if(this->DoSuppressDevWarnings)
{ {
this->CacheManager-> if(this->SuppressDevWarnings)
AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE", {
"Suppress Warnings that are meant for" this->CacheManager->
" the author of the CMakeLists.txt files.", AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE",
cmCacheManager::INTERNAL); "Suppress Warnings that are meant for"
" the author of the CMakeLists.txt files.",
cmCacheManager::INTERNAL);
}
else
{
this->CacheManager->
AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE",
"Suppress Warnings that are meant for"
" the author of the CMakeLists.txt files.",
cmCacheManager::INTERNAL);
}
} }
else
{
this->CacheManager->
AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE",
"Suppress Warnings that are meant for"
" the author of the CMakeLists.txt files.",
cmCacheManager::INTERNAL);
}
int ret = this->ActualConfigure(); int ret = this->ActualConfigure();
const char* delCacheVars = const char* delCacheVars =
this->GetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_"); this->GetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_");

View File

@ -388,6 +388,7 @@ protected:
std::string cmStartDirectory; std::string cmStartDirectory;
std::string StartOutputDirectory; std::string StartOutputDirectory;
bool SuppressDevWarnings; bool SuppressDevWarnings;
bool DoSuppressDevWarnings;
std::set<cmStdString> WrittenFiles; std::set<cmStdString> WrittenFiles;
///! return true if the same cmake was used to make the cache. ///! return true if the same cmake was used to make the cache.