mirror of
https://github.com/ProgramSnail/build_system_2022.git
synced 2025-12-06 00:48:42 +00:00
init
This commit is contained in:
parent
4d899f64a7
commit
b4a7121411
23 changed files with 681 additions and 11 deletions
18
builder.cpp
Normal file
18
builder.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue