X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuilder.cpp;h=17fbd32e2efece9636ea39f0ed05a589a572f8af;hb=05a2b9dabd01414e9e9a91f9d69babaca4ccb32d;hp=77579ea45e60a894da24fb44182e972e7c9ba2be;hpb=433f9ef196b6f5af6bb38447b650f5afaa5a783a;p=builder.git diff --git a/source/builder.cpp b/source/builder.cpp index 77579ea..17fbd32 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -487,7 +487,13 @@ void Builder::problem(const string &p, const string &d) problems.push_back(Problem(p, d)); } -void Builder::add_target(Target *t) +void Builder::add_target(FileTarget *t) +{ + targets.insert(TargetMap::value_type(t->get_path().str(), t)); + new_tgts.push_back(t); +} + +void Builder::add_target(VirtualTarget *t) { targets.insert(TargetMap::value_type(t->get_name(), t)); new_tgts.push_back(t); @@ -620,7 +626,7 @@ int Builder::create_targets() // Apply what-ifs for(StringList::iterator i=what_if.begin(); i!=what_if.end(); ++i) { - Target *tgt = get_target((cwd/ *i).str()); + FileTarget *tgt = dynamic_cast(get_target((cwd/ *i).str())); if(!tgt) { IO::print(IO::cerr, "Unknown what-if target %s\n", *i); @@ -699,9 +705,7 @@ Target *Builder::get_library(const string &lib, const FS::Path &path, LibMode mo if(tgt) { - Target *real_tgt = tgt; - if(Install *inst = dynamic_cast(tgt)) - real_tgt = &inst->get_source(); + Target *real_tgt = tgt->get_real_target(); /* Ignore dynamic libraries from local packages unless library mode is DYNAMIC */