]> git.tdb.fi Git - builder.git/blob - source/gnucompiler.h
Redesign how tools are run
[builder.git] / source / gnucompiler.h
1 #ifndef GNUCOMPILER_H_
2 #define GNUCOMPILER_H_
3
4 #include "tool.h"
5
6 class ObjectFile;
7
8 /**
9 Common base class for GNU compilers.  Turns SourceFiles into ObjectFiles.
10
11 Since invocation is mostly the same for all language frontends, most of the
12 logic is here and the individual tools only handle creating source files of
13 appropriate type.
14 */
15 class GnuCompiler: public Tool
16 {
17 protected:
18         unsigned version;
19
20 public:
21         GnuCompiler(Builder &, const Architecture &, const std::string &);
22
23         Target *create_source(const Component &, const Msp::FS::Path &) const override;
24         Target *create_source(const Msp::FS::Path &) const override;
25         Target *create_target(const std::vector<Target *> &, const std::string &) override;
26         std::string create_build_signature(const BuildInfo &) const override;
27 protected:
28         void do_prepare() override;
29         void prepare_syspath();
30         void prepare_version();
31         void prepare_version(const std::string &);
32
33 private:
34         static Task *_run(const ObjectFile &);
35 };
36
37 #endif