From 45983abe664be648b513202c8c12578c9a85784f Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 3 May 2024 21:03:06 +0200 Subject: Parallel build --- Builder.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Builder.h (limited to 'Builder.h') diff --git a/Builder.h b/Builder.h new file mode 100644 index 0000000..12338f0 --- /dev/null +++ b/Builder.h @@ -0,0 +1,40 @@ +#pragma once + +#include +#include +#include +#include + +#include + +#include "ProcessRunner.h" + +class Builder +{ +public: + Builder(const boost::property_tree::ptree& ptree); + + void build(); + void clean(); + +private: + std::vector dependencies_of(const std::filesystem::path& p); + bool is_outdated(const std::filesystem::path& p); + + void build_file(const std::filesystem::path& p); + void build_list(); + + void cleanup(); + + std::filesystem::path _target; + std::vector _objects; + std::vector _sources; + std::unordered_map> _dependencies; + + ProcessRunner _runner; + + std::unordered_set _buildlist; // build done + std::unordered_set _activelist; // currently building + std::unordered_set _donelist; // build done +}; + -- cgit v1.2.3