summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.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/cmIfCommand.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/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 4eed477..ffc0f35 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<void>(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<std::string> expandedArguments;