From da749a585ab920d10f6379ebc465221732d23610 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 28 Jan 2025 16:09:26 +0100 Subject: Progress reporting: also report the primary action output While reporting an origin target with action number within that target describes an action uniquely in a way meaningful to the user, it might not always be eay to unserstand which precise action is currently running. For example, for a library with many source files, we have a target generating a large number of actions and the association of source file to action number requires detailled knowledge of the build description. The name of the primary ouput of that action, on the other hand immediately identifies the file that is compiled. Therefore, report this as well. --- src/buildtool/progress_reporting/progress.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/buildtool/progress_reporting/progress.hpp') diff --git a/src/buildtool/progress_reporting/progress.hpp b/src/buildtool/progress_reporting/progress.hpp index d3ca54dd..5c6573b2 100644 --- a/src/buildtool/progress_reporting/progress.hpp +++ b/src/buildtool/progress_reporting/progress.hpp @@ -41,6 +41,13 @@ class Progress { return origin_map_; } + // Return a reference to the output map. It is the responsibility of the + // caller to ensure that access only happens in a single-threaded context. + [[nodiscard]] auto OutputMap() noexcept + -> std::unordered_map& { + return output_map_; + } + private: ::TaskTracker task_tracker_{}; std::unordered_map< @@ -48,6 +55,7 @@ class Progress { std::vector< std::pair>> origin_map_; + std::unordered_map output_map_; }; #endif // INCLUDED_SRC_BUILDTOOL_PROGRESS_REPORTING_PROGRESS_HPP -- cgit v1.2.3