#pragma once #include #include #include #include #include #include #include "LanguageSettings.h" #include "ProcessRunner.h" class Builder { public: Builder(const boost::property_tree::ptree& ptree, const std::string& target); void build(); void run_tests(); void clean() const; private: std::unordered_map> get_dependencies(const boost::property_tree::ptree& ptree) const; std::vector dependencies_of(const std::filesystem::path& p) const; std::vector include_paths_of(const std::filesystem::path& p) const; std::vector link_libs_of(const std::filesystem::path& p) const; bool is_outdated(const std::filesystem::path& p) const; bool is_outdated(const std::filesystem::path& p, const std::vector &dependencies) const; std::vector make_depfile_from(const std::filesystem::path& p) const; void build_file(const std::filesystem::path& p); void build_filelist(); void cleanup_buildlist(); const boost::property_tree::ptree _ptree; std::string _target; std::vector _all_targets; std::vector _all_objects; std::unordered_map> _dependencies; std::unordered_map> _include_paths; std::unordered_map> _link_libs; LanguageSettings _lang; ProcessRunner _runner; std::unordered_set _buildlist; // build done std::unordered_set _activelist; // currently building std::unordered_set _donelist; // build done };