From: Mikko Rasa Date: Fri, 1 Dec 2017 11:09:22 +0000 (+0200) Subject: Have SubTool automatically pass calls to the parent tool X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=82f1175238a94618b0cf1485b0132fb965996843;p=builder.git Have SubTool automatically pass calls to the parent tool --- diff --git a/source/gnulinker.cpp b/source/gnulinker.cpp index cc0a50d..a93f809 100644 --- a/source/gnulinker.cpp +++ b/source/gnulinker.cpp @@ -131,16 +131,6 @@ GnuLinker::Linker::Linker(GnuLinker &p, const string &ct): throw invalid_argument("GnuLinker::Linker::Linker"); } -Target *GnuLinker::Linker::create_target(const list &sources, const string &arg) -{ - return parent.create_target(sources, arg); -} - -Target *GnuLinker::Linker::create_install(Target &target) const -{ - return parent.create_install(target); -} - string GnuLinker::Linker::create_build_signature(const BuildInfo &binfo) const { string result = FS::basename(executable->get_path()); diff --git a/source/gnulinker.h b/source/gnulinker.h index 8d63538..872234a 100644 --- a/source/gnulinker.h +++ b/source/gnulinker.h @@ -21,8 +21,6 @@ private: public: Linker(GnuLinker &, const std::string &); - virtual Target *create_target(const std::list &, const std::string &); - virtual Target *create_install(Target &) const; virtual std::string create_build_signature(const BuildInfo &) const; private: virtual void do_prepare(); diff --git a/source/tool.cpp b/source/tool.cpp index e2afe79..f3a2990 100644 --- a/source/tool.cpp +++ b/source/tool.cpp @@ -74,6 +74,31 @@ SubTool::SubTool(Tool &p): parent(p) { } +Target *SubTool::create_source(const Component &c, const FS::Path &p) const +{ + return parent.create_source(c, p); +} + +Target *SubTool::create_source(const FS::Path &p) const +{ + return parent.create_source(p); +} + +Target *SubTool::create_target(const list &s, const string &a) +{ + return parent.create_target(s, a); +} + +Target *SubTool::create_install(Target &t) const +{ + return parent.create_install(t); +} + +string SubTool::create_build_signature(const BuildInfo &bi) const +{ + return parent.create_build_signature(bi); +} + void operator>>(const LexicalConverter &conv, Tool::ProcessingUnit &unit) { diff --git a/source/tool.h b/source/tool.h index 2f8c25b..41b8c5f 100644 --- a/source/tool.h +++ b/source/tool.h @@ -134,6 +134,13 @@ protected: Tool &parent; SubTool(Tool &); + +public: + virtual Target *create_source(const Component &, const Msp::FS::Path &) const; + virtual Target *create_source(const Msp::FS::Path &) const; + virtual Target *create_target(const std::list &, const std::string & = std::string()); + virtual Target *create_install(Target &) const; + virtual std::string create_build_signature(const BuildInfo &) const; };