Browse Source

cmake: Make entire in-progress check stack available internally

Represent it as a `vector` so we can iterate over the whole stack.
Brad King 2 years ago
parent
commit
189557bd74
1 changed files with 4 additions and 5 deletions
  1. 4 5
      Source/cmake.h

+ 4 - 5
Source/cmake.h

@@ -9,7 +9,6 @@
 #include <map>
 #include <memory>
 #include <set>
-#include <stack>
 #include <string>
 #include <unordered_set>
 #include <utility>
@@ -472,13 +471,13 @@ public:
   }
   std::string GetTopCheckInProgressMessage()
   {
-    auto message = this->CheckInProgressMessages.top();
-    this->CheckInProgressMessages.pop();
+    auto message = this->CheckInProgressMessages.back();
+    this->CheckInProgressMessages.pop_back();
     return message;
   }
   void PushCheckInProgressMessage(std::string message)
   {
-    this->CheckInProgressMessages.emplace(std::move(message));
+    this->CheckInProgressMessages.emplace_back(std::move(message));
   }
 
   //! Should `message` command display context.
@@ -773,7 +772,7 @@ private:
   bool LogLevelWasSetViaCLI = false;
   bool LogContext = false;
 
-  std::stack<std::string> CheckInProgressMessages;
+  std::vector<std::string> CheckInProgressMessages;
 
   std::unique_ptr<cmGlobalGenerator> GlobalGenerator;