variable_watch: Remove leftover debugging code (#14187)

When a watch does not specify a command to call then variable_watch
prints out a message to stderr.  Remove code after that which collects
all variable values to construct a message that is never printed.
Otherwise such code causes a READ_ACCESS watch to trigger on all
variables in the currents scope.

Reported-by: Yichao Yu <yyc1992@gmail.com>
This commit is contained in:
Brad King 2013-06-03 13:04:56 -04:00
parent c63d30048b
commit 515f9af0d4
4 changed files with 13 additions and 13 deletions

View File

@ -122,19 +122,6 @@ void cmVariableWatchCommand::VariableAccessed(const std::string& variable,
msg << " The value of the variable: \"" << newValue << "\"" << std::endl;
msg << " The list file stack: " << stack.c_str();
cmSystemTools::Message(msg.str().c_str());
std::vector<std::string> vars = makefile->GetDefinitions();
cmOStringStream msg2;
size_t cc;
for ( cc = 0; cc < vars.size(); cc ++ )
{
if ( vars[cc] == variable )
{
continue;
}
msg2 << vars[cc] << " = \""
<< makefile->GetDefinition(vars[cc].c_str()) << "\"" << std::endl;
}
//cmSystemTools::Message(msg2.str().c_str());
}
this->InCallback = false;
}

View File

@ -0,0 +1,4 @@
my_func
\* Variable "b" was accessed using MODIFIED_ACCESS in: .*/Tests/RunCMake/variable_watch/NoWatcher.cmake
The value of the variable: ""
The list file stack: .*/Tests/RunCMake/variable_watch/CMakeLists.txt;.*/Tests/RunCMake/variable_watch/NoWatcher.cmake$

View File

@ -0,0 +1,8 @@
function(my_func)
message("my_func")
endfunction()
variable_watch(a my_func)
set(a "")
variable_watch(b)
set(b "")

View File

@ -1,3 +1,4 @@
include(RunCMake)
run_cmake(ModifiedAccess)
run_cmake(NoWatcher)