X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuilder.cpp;h=1b8ed3c16eb538d17afbc3933089f750bd12e4be;hb=aa053d637e8259755af7d2e4b510a242f4d29c7b;hp=ceb7db3581f7db02915b8433fdfda56532657811;hpb=690b9c5f340504517cf6ba8aad0c168dcdff4efa;p=builder.git diff --git a/source/builder.cpp b/source/builder.cpp index ceb7db3..1b8ed3c 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -1,4 +1,6 @@ +#include #include +#include #include #include #include @@ -70,6 +72,13 @@ vector Builder::get_build_types() const return keys; } +const BuildType &Builder::get_build_type() const +{ + if(!build_type) + throw invalid_state("no build type"); + return *build_type; +} + void Builder::set_build_type(const string &name) { build_type = &get_item(build_types, name); @@ -105,9 +114,9 @@ void Builder::set_logger(const Logger *l) logger = (l ? l : &default_logger); } -list Builder::collect_problems() const +vector Builder::collect_problems() const { - list problems; + vector problems; set broken_packages; set broken_components; set broken_tools; @@ -259,7 +268,7 @@ int Builder::clean(bool all, bool dry_run) // Cleaning doesn't care about ordering, so a simpler method can be used set clean_tgts; - list queue; + deque queue; queue.push_back(&build_graph.get_goals()); while(!queue.empty()) @@ -324,7 +333,7 @@ void Builder::Loader::build_type(const string &n) { BuildType btype(n); load_sub(btype); - auto i = obj.build_types.insert(BuildTypeMap::value_type(n, btype)).first; + auto i = obj.build_types.insert({ n, btype }).first; if(!obj.build_type) obj.build_type = &i->second; } @@ -333,10 +342,7 @@ void Builder::Loader::package(const string &n) { SourcePackage *pkg = new SourcePackage(obj, n, get_source()); - if(options) - load_sub(*pkg, *options); - else - load_sub(*pkg); + load_sub(*pkg, options); if(obj.build_type) pkg->set_build_type(*obj.build_type);