X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftool.h;h=6fa4fb5c127090bf81a0ded5574c14bd2aa0bc69;hb=451ef4f33b5a57dcb56bd7cb671bed359ac86247;hp=ce08a00af62aedc0aae64b8d901d579881103797;hpb=aa053d637e8259755af7d2e4b510a242f4d29c7b;p=builder.git diff --git a/source/tool.h b/source/tool.h index ce08a00..6fa4fb5 100644 --- a/source/tool.h +++ b/source/tool.h @@ -31,26 +31,28 @@ public: protected: Builder &builder; - const Architecture *architecture; + const Architecture *architecture = 0; std::string tag; std::string command; - FileTarget *executable; + FileTarget *executable = 0; std::vector input_suffixes; std::vector aux_suffixes; - ProcessingUnit processing_unit; + ProcessingUnit processing_unit = ONE_FILE; VirtualFileSystem::SearchPath system_path; BuildInfo build_info; - bool prepared; + bool prepared = false; std::vector problems; - Tool(Builder &, const std::string &); - Tool(Builder &, const Architecture &, const std::string &); + Tool(Builder &b, const std::string &t): Tool(b, 0, t) { } + Tool(Builder &b, const Architecture &a, const std::string &t): Tool(b, &a, t) { } +private: + Tool(Builder &b, const Architecture *a, const std::string &t): builder(b), architecture(a), tag(t) { } public: virtual ~Tool() { } const std::string &get_tag() const { return tag; } - /** Returns the architecture this tool build for. May return null if the + /** Returns the architecture this tool builds for. May return null if the tool is architecture-agnostic. */ const Architecture *get_architecture() const { return architecture; } @@ -131,7 +133,7 @@ class SubTool: public Tool protected: Tool &parent; - SubTool(Tool &); + SubTool(Tool &t): Tool(t), parent(t) { } public: Target *create_source(const Component &, const Msp::FS::Path &) const override;