summaryrefslogtreecommitdiff
path: root/src/tasks.h
blob: c5b326ee4ccd38f1a3592dee9b69abff23b998f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// -*- c++ -*-
#pragma once

#include <string>
#include <list>
#include <memory>
#include <deque>

#include "task.h"

class BuildConfiguration;
class Settings;

struct Target
{
	BuildConfiguration config;
	std::string path;
};

//! Get list of all registered targets
const std::deque<Target>& getTargets(const Settings& settings);

//! Returns next dirty task from the dirtyTasks list that has all its dependencies
//! fulfilled.
//! The returned task is removed from the dirty list.
//! Return nullptr if no dirty task is ready.
std::shared_ptr<Task> getNextTask(const std::list<std::shared_ptr<Task>>& allTasks,
                                  std::list<std::shared_ptr<Task>>& dirtyTasks);

//! Get list of tasks filtered by name including each of their direct
//! dependency tasks (ie. objects tasks from their sources).
std::list<std::shared_ptr<Task>> getTasks(const Settings& settings,
                                          const std::vector<std::string> names = {});