From: Mikko Rasa Date: Sat, 6 Feb 2010 07:31:38 +0000 (+0000) Subject: Add --no-externals option X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=782df8c2a38d9f88d30fecc525d72c45db8efa8e;p=builder.git Add --no-externals option --- diff --git a/source/builder.cpp b/source/builder.cpp index 17fbd32..37ad766 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -85,6 +85,7 @@ Builder::Builder(int argc, char **argv): getopt.add_option('j', "jobs", jobs, GetOpt::REQUIRED_ARG).set_help("Run NUM commands at once, whenever possible.", "NUM"); getopt.add_option('n', "dry-run", dry_run, GetOpt::NO_ARG).set_help("Don't actually do anything, only show what would be done."); getopt.add_option('v', "verbose", verbose, GetOpt::NO_ARG).set_help("Print more information about what's going on."); + getopt.add_option('x', "no-externals", no_externals, GetOpt::NO_ARG).set_help("Do not load external source packages."); getopt.add_option('A', "conf-all", conf_all, GetOpt::NO_ARG).set_help("Apply configuration to all packages."); getopt.add_option('B', "build-all", build_all, GetOpt::NO_ARG).set_help("Build all targets unconditionally."); getopt.add_option('C', "chdir", work_dir, GetOpt::REQUIRED_ARG).set_help("Change to DIR before doing anything else.", "DIR"); @@ -340,12 +341,15 @@ Package *Builder::get_package(const string &name) if(i!=packages.end()) return i->second; - FS::Path path = get_package_location(name); - if(!path.empty() && !load_build_file(path/"Build")) + if(!no_externals) { - i = packages.find(name); - if(i!=packages.end()) - return i->second; + FS::Path path = get_package_location(name); + if(!path.empty() && !load_build_file(path/"Build")) + { + i = packages.find(name); + if(i!=packages.end()) + return i->second; + } } Package *pkg = 0; diff --git a/source/builder.h b/source/builder.h index 9dca6f0..6835299 100644 --- a/source/builder.h +++ b/source/builder.h @@ -71,6 +71,7 @@ private: SourcePackage *main_pkg; PathList pkg_path; PathList pkg_dirs; + bool no_externals; TargetMap targets; TargetList new_tgts;