From: Mikko Rasa Date: Sun, 8 Jul 2012 22:39:37 +0000 (+0300) Subject: Connect to bubble_rebuild signals after preparing to avoid confusion X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c71c9dfe748593b4c625d0f7e8f136a82c8b23c1;p=builder.git Connect to bubble_rebuild signals after preparing to avoid confusion --- diff --git a/source/target.cpp b/source/target.cpp index cf227a4..095228b 100644 --- a/source/target.cpp +++ b/source/target.cpp @@ -60,7 +60,8 @@ void Target::add_depend(Target *dep) if(dep==this) throw invalid_argument("Target::add_depend"); depends.push_back(dep); - dep->signal_bubble_rebuild.connect(sigc::mem_fun(this, &Target::check_rebuild)); + if(state>PREPARING) + dep->signal_bubble_rebuild.connect(sigc::mem_fun(this, &Target::check_rebuild)); } void Target::prepare() @@ -87,6 +88,9 @@ void Target::prepare() check_rebuild(); if(state==PREPARING) state = UPTODATE; + + for(Dependencies::iterator i=depends.begin(); i!=depends.end(); ++i) + (*i)->signal_bubble_rebuild.connect(sigc::mem_fun(this, &Target::check_rebuild)); } Task *Target::build() @@ -116,9 +120,10 @@ void Target::mark_rebuild(const string &reason) state = REBUILD; rebuild_reason = reason; - signal_bubble_rebuild.emit(); builder.get_logger().log("rebuild", format("Rebuilding %s: %s", name, reason)); + + signal_bubble_rebuild.emit(); } void Target::build_finished(bool /*success*/)