From: Mikko Rasa Date: Thu, 22 Aug 2013 12:06:07 +0000 (+0300) Subject: Check an ObjectFile's dependencies again if a dependency is modified X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=df88e22a258f169b9505acb0cb8d0ba7e66af7b6;p=builder.git Check an ObjectFile's dependencies again if a dependency is modified This is necessary to get generated sources to behave correctly. Includes can only be read after they're built for the first time. The ObjectFile must then add the necessary dependencies to ensure that required headers are installed. --- diff --git a/source/objectfile.cpp b/source/objectfile.cpp index 97b5c75..7208f42 100644 --- a/source/objectfile.cpp +++ b/source/objectfile.cpp @@ -86,5 +86,9 @@ void ObjectFile::find_dependencies(FileTarget *tgt) for(Dependencies::const_iterator i=deps_to_add.begin(); i!=deps_to_add.end(); ++i) if(find(depends.begin(), depends.end(), *i)==depends.end()) + { add_dependency(**i); + if((*i)->get_real_target()->is_buildable()) + (*i)->signal_modified.connect(sigc::mem_fun(this, static_cast(&ObjectFile::find_dependencies))); + } } diff --git a/source/target.cpp b/source/target.cpp index 55f73a0..0d8c2da 100644 --- a/source/target.cpp +++ b/source/target.cpp @@ -175,5 +175,6 @@ void Target::build_finished(bool success) modified(); for(Dependencies::const_iterator i=side_effects.begin(); i!=side_effects.end(); ++i) (*i)->build_finished(success); + signal_modified.emit(); } } diff --git a/source/target.h b/source/target.h index 64a132c..114a51e 100644 --- a/source/target.h +++ b/source/target.h @@ -41,6 +41,7 @@ protected: public: sigc::signal signal_bubble_rebuild; + sigc::signal signal_modified; protected: Builder &builder;