From 647b533bce48b741a6b048a1e62b24b9bb2f8d23 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 7 Jul 2015 23:37:20 +0200 Subject: [PATCH] cmMakefile: Implement FormatListFileStack in terms of cmState. --- Source/cmMakefile.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 94c77e13e..cbaf97244 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4439,14 +4439,22 @@ void cmMakefile::AddCMakeDependFilesFromUser() std::string cmMakefile::FormatListFileStack() const { + std::vector listFiles; + cmState::Snapshot snp = this->StateSnapshot; + while (snp.IsValid()) + { + listFiles.push_back(snp.GetExecutionListFile()); + snp = snp.GetCallStackParent(); + } + std::reverse(listFiles.begin(), listFiles.end()); std::ostringstream tmp; - size_t depth = this->ListFileStack.size(); + size_t depth = listFiles.size(); if (depth > 0) { - std::vector::const_iterator it = this->ListFileStack.end(); + std::vector::const_iterator it = listFiles.end(); do { - if (depth != this->ListFileStack.size()) + if (depth != listFiles.size()) { tmp << "\n "; } @@ -4457,7 +4465,7 @@ std::string cmMakefile::FormatListFileStack() const tmp << *it; depth--; } - while (it != this->ListFileStack.begin()); + while (it != listFiles.begin()); } return tmp.str(); }