From 4c3e451a852b537c04f5b73af23639902117b94f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jul 2016 09:23:55 +0200 Subject: Change default var override from 'projects and subprojects' to amalgamation The 'projects and subprojects' semantics resulted in some counter-intuitive behavior. For example, in a project with tests/ as a subproject if one builds one of the tests directly with a non-global override (say C++ compiler), then the main project would be built without the overrides. I this light, overriding in the whole amalgamation seems like the right thing to do. The old behavior can still be obtained with scope qualification, for example: b ./:foo=bar --- build2/context.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'build2/context.cxx') diff --git a/build2/context.cxx b/build2/context.cxx index 60e55bd..e08fb52 100644 --- a/build2/context.cxx +++ b/build2/context.cxx @@ -183,6 +183,9 @@ namespace build2 if (r.first.type != nullptr) fail << "typed override of variable " << n; + // Global and scope overrides we can enter directly. Project ones will + // be entered by the caller for for each amalgamation/project. + // if (c == '!' || !dir.empty ()) { scope& s (c == '!' ? gs : scopes.insert (dir, false)->second); -- cgit v1.1