]> git.tdb.fi Git - builder.git/commitdiff
Target::build is virtual, so put the special case in the appropriate class
authorMikko Rasa <tdb@tdb.fi>
Tue, 7 May 2013 20:40:30 +0000 (23:40 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 8 May 2013 07:19:53 +0000 (10:19 +0300)
source/target.cpp
source/virtualtarget.cpp
source/virtualtarget.h

index 691f70038e932bb79df4f71567cd72eb1f197899..a9ad8e7063931006a3a6b3ba5de961a6d1f33fdf 100644 (file)
@@ -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;
index 3a3b254e99945e52245e3d1d06bb6e8047493e01..a7b4cd73b35362d2d0586ecda7e570d2abaf8b07 100644 (file)
@@ -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;
+}
index bd39e5fbaf1fcc664af9786e9476f00fc48184f5..8f3d95b0c0b540d16ab0b5dafc21db7235de98ef 100644 (file)
@@ -14,6 +14,9 @@ public:
        virtual const char *get_type() const { return "VirtualTarget"; }
 private:
        virtual void check_rebuild();
+
+public:
+       virtual Task *build();
 };
 
 #endif