+
+void BuildGraph::add_goal(Target &t)
+{
+ goals->add_dependency(t);
+}
+
+void BuildGraph::prepare()
+{
+ if(goals->get_dependencies().empty())
+ add_goal(*get_target("default"));
+ goals->prepare();
+}
+
+void BuildGraph::force_full_rebuild()
+{
+ for(const auto &kvp: targets)
+ if(kvp.second->is_buildable() && !kvp.second->needs_rebuild())
+ kvp.second->force_rebuild();
+}
+
+unsigned BuildGraph::count_rebuild_targets() const
+{
+ unsigned count = 0;
+ for(const auto &kvp: targets)
+ if(kvp.second->is_buildable() && kvp.second->needs_rebuild())
+ ++count;
+ return count;
+}
+
+Target *BuildGraph::get_buildable_target() const
+{
+ return goals->get_buildable_target();
+}