From b3b095a933d7f355fcdd57c041c771b7618c9717 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 14 May 2012 18:50:30 -0400 Subject: 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. --- Source/cmIfCommand.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Source/cmIfCommand.cxx') diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 4eed477284..ffc0f35b89 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -74,6 +74,13 @@ IsFunctionBlocked(const cmListFileFunction& lff, { this->IsBlocking = this->HasRun; this->HasRun = true; + + // if trace is enabled, print a (trivially) evaluated "else" + // statement + if(!this->IsBlocking && mf.GetCMakeInstance()->GetTrace()) + { + mf.PrintCommandTrace(this->Functions[c]); + } } else if (scopeDepth == 0 && !cmSystemTools::Strucmp (this->Functions[c].Name.c_str(),"elseif")) @@ -88,6 +95,12 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefileCall stack_manager(&mf, this->Functions[c], status); static_cast(stack_manager); + // if trace is enabled, print the evaluated "elseif" statement + if(mf.GetCMakeInstance()->GetTrace()) + { + mf.PrintCommandTrace(this->Functions[c]); + } + std::string errorString; std::vector expandedArguments; -- cgit v1.2.1