#include "tool.h"
+class ObjectFile;
+
+/**
+Common base class for GNU compilers. Turns SourceFiles into ObjectFiles.
+
+Since invocation is mostly the same for all language frontends, most of the
+logic is here and the individual tools only handle creating source files of
+appropriate type.
+*/
class GnuCompiler: public Tool
{
+public:
+ GnuCompiler(Builder &, const Architecture &, const std::string &);
+
+ Target *create_source(const Component &, const Msp::FS::Path &) const override;
+ Target *create_source(const Msp::FS::Path &) const override;
+ Target *create_target(const std::vector<Target *> &, const std::string &) override;
+ std::string create_build_signature(const BuildInfo &) const override;
protected:
- GnuCompiler(Builder &, const std::string &, const std::string &);
+ void do_prepare(ToolData &) const override;
+ void prepare_syspath(ToolData &) const;
+ void prepare_version(ToolData &) const;
+ unsigned query_version(const std::string &, const std::string &) const;
-public:
- virtual Target *create_target(const std::list<Target *> &, const std::string &) const;
- virtual Task *run(const Target &) const;
+private:
+ static ExternalTask::Arguments _run(const ObjectFile &, Msp::FS::Path &);
};
#endif