This is a bit crude since the dependencies are not sorted, but still
avoids a massive slowdown from updating dependencies many times when a
header is generated.
vector<FileTarget *> headers;
find_dependencies(source, headers);
for(FileTarget *h: headers)
- {
- add_dependency(*h);
- if(h->get_real_target()->is_buildable())
- h->signal_modified.connect(sigc::mem_fun(this, static_cast<void (ObjectFile::*)()>(&ObjectFile::find_dependencies)));
- }
+ if(!any_equals(depends, static_cast<Target *>(h)))
+ {
+ add_dependency(*h);
+ if(h->get_real_target()->is_buildable())
+ h->signal_modified.connect(sigc::mem_fun(this, static_cast<void (ObjectFile::*)()>(&ObjectFile::find_dependencies)));
+ }
}
void ObjectFile::find_dependencies(FileTarget &tgt, vector<FileTarget *> &headers)