- const TargetList &depends = tgt.get_depends();
- //XXX If we want to sort the targets, we need to take the value of full_paths into account
- //depends.sort(target_order);
- for(TargetList::const_iterator i=depends.begin(); i!=depends.end(); ++i)
- build_depend_table(**i, depth+1);
+ Target::Dependencies depends;
+ if(mode==RDEPS)
+ {
+ const set<Target *> &rdeps = rdepends[&tgt];
+ depends.assign(rdeps.begin(), rdeps.end());
+ }
+ else
+ {
+ depends = tgt.get_dependencies();
+ const Target::Dependencies &tdeps = tgt.get_transitive_dependencies();
+ depends.insert(depends.end(), tdeps.begin(), tdeps.end());
+ }
+
+ sort(depends, (full_paths ? target_order_full : target_order));
+
+ for(Target *d: depends)
+ build_depend_table(*d, depth+1);