X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftool.h;h=be3646cd8f0f674a6022980a1205de5aa5c7b6b9;hb=1496723307ed47b60d3116623ba383e85b50efef;hp=73be90d30a34a92f18235d9f9ece3d29f623318d;hpb=9e28243c9687608ec3c32954b4031490296ae877;p=builder.git diff --git a/source/tool.h b/source/tool.h index 73be90d..be3646c 100644 --- a/source/tool.h +++ b/source/tool.h @@ -32,6 +32,7 @@ protected: SuffixList aux_suffixes; SearchPath system_path; bool prepared; + std::list problems; Tool(Builder &, const std::string &); Tool(Builder &, const Architecture &, const std::string &); @@ -40,6 +41,10 @@ public: const std::string &get_tag() const { return tag; } + /** Returns the architecture this tool build for. May return null if the + tool is architecture-agnostic. */ + const Architecture *get_architecture() const { return architecture; } + /** Returns a target for the tool's own executable. If the tool does not use an external program, returns null. */ FileTarget *get_executable() const { return executable; } @@ -85,7 +90,14 @@ public: protected: virtual void do_prepare() { } + /** Locates an executable for the tool from the VFS. If it isn't found, a + problem is reported. If cross is true and the architecture is not native, + a cross prefix is added to the command. */ + void set_executable(const std::string &command, bool cross = false); + public: + const std::list &get_problems() const { return problems; } + /** Invokes the tool to build a target. This should not be called directly; use Target::build() instead. */ virtual Task *run(const Target &) const = 0;