From d552de5d028e1dfb108f343810604d0dfd74c2e6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Sep 2021 17:00:08 +0200 Subject: Consistently install prerequisites from any scope by default It is also now possible to adjust this behavior with global config.install.scope override. Valid values for this variable are: project -- only from project strong -- from strong amalgamation weak -- from weak amalgamation global -- from all projects (default) --- libbuild2/install/init.cxx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'libbuild2/install/init.cxx') diff --git a/libbuild2/install/init.cxx b/libbuild2/install/init.cxx index 677ee07..5b5d1e2 100644 --- a/libbuild2/install/init.cxx +++ b/libbuild2/install/init.cxx @@ -392,6 +392,37 @@ namespace build2 // Configuration. // + + // config.install.scope + // + // We do not install prerequisites (for example, shared libraries) of + // targets (for example, executables) that belong to projects outside of + // this scope. Valid values are: + // + // project -- project scope + // strong -- strong amalgamation + // weak -- weak amalgamation + // global -- all projects (default) + // + // Note: can only be specified as a global override. + // + { + auto& v (vp.insert ("config.install.scope")); + + // If specified, verify it is a global override. + // + if (lookup l = rs[v]) + { + if (!l.belongs (rs.global_scope ())) + fail << "config.install.scope must be a global override" << + info << "specify !config.install.scope=..."; + } + + config::unsave_variable (rs, v); + } + + // Installation directories. + // // Note that we don't use any defaults for root -- the location // must be explicitly specified or the installer will complain // if and when we try to install. -- cgit v1.1