if(i->second && i->second->is_configured())
i->second->create_targets();
- // Apply what-ifs
- // XXX This does not currently work with targets found during dependency discovery
- for(StringList::iterator i=what_if.begin(); i!=what_if.end(); ++i)
- {
- FileTarget *tgt = vfs.get_target(cwd/ *i);
- if(!tgt)
- {
- IO::print(IO::cerr, "Unknown what-if target %s\n", *i);
- return -1;
- }
- tgt->touch();
- }
-
// Make the cmdline target depend on all targets mentioned on the command line
Target *cmdline = new VirtualTarget(*this, "cmdline");
for(list<string>::iterator i=cmdline_targets.begin(); i!=cmdline_targets.end(); ++i)
cmdline->prepare();
+ // Apply what-ifs
+ for(StringList::iterator i=what_if.begin(); i!=what_if.end(); ++i)
+ {
+ FileTarget *tgt = vfs.get_target(cwd/ *i);
+ if(!tgt)
+ {
+ IO::print(IO::cerr, "Unknown what-if target %s\n", *i);
+ return -1;
+ }
+ tgt->touch();
+ }
+
for(PackageMap::iterator i=packages.begin(); i!=packages.end(); ++i)
if(SourcePackage *spkg = dynamic_cast<SourcePackage *>(i->second))
spkg->get_deps_cache().save();