From: Mikko Rasa Date: Tue, 7 May 2013 20:40:30 +0000 (+0300) Subject: Target::build is virtual, so put the special case in the appropriate class X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=fa2beaa15ccc64956b12d6d81d95a11538748327;p=builder.git Target::build is virtual, so put the special case in the appropriate class --- diff --git a/source/target.cpp b/source/target.cpp index 691f700..a9ad8e7 100644 --- a/source/target.cpp +++ b/source/target.cpp @@ -122,13 +122,6 @@ void Target::prepare() Task *Target::build() { - if(!tool) - { - // This special case is needed for VirtualTargets - state = UPTODATE; - return 0; - } - Task *task = tool->run(*this); task->signal_finished.connect(sigc::mem_fun(this, &Target::build_finished)); state = BUILDING; diff --git a/source/virtualtarget.cpp b/source/virtualtarget.cpp index 3a3b254..a7b4cd7 100644 --- a/source/virtualtarget.cpp +++ b/source/virtualtarget.cpp @@ -17,3 +17,9 @@ void VirtualTarget::check_rebuild() if((*i)->needs_rebuild()) mark_rebuild((*i)->get_name()+" needs rebuilding"); } + +Task *VirtualTarget::build() +{ + state = UPTODATE; + return 0; +} diff --git a/source/virtualtarget.h b/source/virtualtarget.h index bd39e5f..8f3d95b 100644 --- a/source/virtualtarget.h +++ b/source/virtualtarget.h @@ -14,6 +14,9 @@ public: virtual const char *get_type() const { return "VirtualTarget"; } private: virtual void check_rebuild(); + +public: + virtual Task *build(); }; #endif