jak-project/goalc/make/Tool.h
water111 ef011f4fe8
[goalc] add a build system (#704)
* add first attempt at build system

* fix stupid bug

* try again
2021-07-15 21:37:15 -04:00

25 lines
639 B
C++

#pragma once
#include <optional>
#include <string>
#include <vector>
struct ToolInput {
std::string& input; // the input file
std::vector<std::string>& deps; // explicit dependencies
std::vector<std::string>& output; // produced output files.
};
class Tool {
public:
Tool(const std::string& name);
virtual bool run(const ToolInput& task) = 0;
virtual std::vector<std::string> get_additional_dependencies(const ToolInput&) { return {}; }
virtual bool needs_run(const ToolInput& task);
virtual ~Tool() = default;
const std::string& name() const { return m_name; }
private:
std::string m_name;
};