From 782df8c2a38d9f88d30fecc525d72c45db8efa8e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 6 Feb 2010 07:31:38 +0000 Subject: [PATCH] Add --no-externals option --- source/builder.cpp | 14 +++++++++----- source/builder.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) 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; -- 2.43.0