summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrian Helba <brian.helba@kitware.com>2012-05-14 22:50:30 (GMT)
committerBrad King <brad.king@kitware.com>2012-05-16 13:07:55 (GMT)
commitb3b095a933d7f355fcdd57c041c771b7618c9717 (patch)
tree9519737931931c665d675f16c0fd2b7c9273032f /Source/cmMakefile.cxx
parent75c0304a9ee646c8a408f713477fa3522ab1e8a8 (diff)
downloadCMake-b3b095a933d7f355fcdd57c041c771b7618c9717.zip
CMake-b3b095a933d7f355fcdd57c041c771b7618c9717.tar.gz
CMake-b3b095a933d7f355fcdd57c041c771b7618c9717.tar.bz2
Print any evaluated 'elseif'/'else' commands in trace mode (#13220)
In trace mode ('--trace'), any 'elseif' or 'else' commands that are evaluated as part of a conditional block will be printed. Previously, only the opening 'if' command of a conditional block was printed.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx30
1 files changed, 18 insertions, 12 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0a709ae..a60896f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -354,6 +354,22 @@ bool cmMakefile::GetBacktrace(cmListFileBacktrace& backtrace) const
}
//----------------------------------------------------------------------------
+void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff)
+{
+ cmOStringStream msg;
+ msg << lff.FilePath << "(" << lff.Line << "): ";
+ msg << lff.Name << "(";
+ for(std::vector<cmListFileArgument>::const_iterator i =
+ lff.Arguments.begin(); i != lff.Arguments.end(); ++i)
+ {
+ msg << i->Value;
+ msg << " ";
+ }
+ msg << ")";
+ cmSystemTools::Message(msg.str().c_str());
+}
+
+//----------------------------------------------------------------------------
bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
cmExecutionStatus &status)
{
@@ -385,20 +401,10 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
|| pcmd->IsScriptable()))
{
- // if trace is one, print out invoke information
+ // if trace is enabled, print out invoke information
if(this->GetCMakeInstance()->GetTrace())
{
- cmOStringStream msg;
- msg << lff.FilePath << "(" << lff.Line << "): ";
- msg << lff.Name << "(";
- for(std::vector<cmListFileArgument>::const_iterator i =
- lff.Arguments.begin(); i != lff.Arguments.end(); ++i)
- {
- msg << i->Value;
- msg << " ";
- }
- msg << ")";
- cmSystemTools::Message(msg.str().c_str());
+ this->PrintCommandTrace(lff);
}
// Try invoking the command.
if(!pcmd->InvokeInitialPass(lff.Arguments,status) ||