build_system_2022/builder.cpp
ProgramSnail b4a7121411 init
2022-08-04 01:22:09 +03:00

18 lines
No EOL
436 B
C++

#include "builder.hpp"
namespace build_system {
void Builder::execute(const BuildGraph& build_graph, size_t target_id) {
// can throw IncorrectBuildGraph
auto targets_order = build_graph.getRequiredTargetsOrder(target_id);
for (auto& target : targets_order) {
thread_pool_.addTarget(std::move(target.task), target.id, target.dependences);
}
thread_pool_.start();
thread_pool_.wait();
}
}; // namespace build_system