From 42257647f90d9180cfbc5b20f8b1b7a0ffef7e26 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 11 Mar 2020 12:05:37 +0200 Subject: Minor config variable lookup cleanups --- libbuild2/cc/module.cxx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'libbuild2/cc') diff --git a/libbuild2/cc/module.cxx b/libbuild2/cc/module.cxx index d8365e4..138a11b 100644 --- a/libbuild2/cc/module.cxx +++ b/libbuild2/cc/module.cxx @@ -113,11 +113,12 @@ namespace build2 // user changes the source of the pattern/mode, this one will get // updated as well. // - p = config::required (rs, - config_x, - move (d), - false, - cc_loaded ? config::save_commented : 0); + p = config::required ( + rs, + config_x, + move (d), + false, + cc_loaded ? config::save_default_commented : 0); } // Split the value into the compiler path and mode. @@ -349,6 +350,16 @@ namespace build2 // over. So what we are going to do is only append to a value if // it came from this scope. Then the usage for merging becomes: // + // @@ There are actually two cases to this issue: + // + // 1. The module is loaded in the outer project (e.g., tests inside a + // project). It feels like this should be handled with project- + // specific variable visibility. + // + // 2. The module is loaded in the outer scope within the same + // project. We are currently thinking whether we should even + // support loading of modules in non-root scopes. + // // x.coptions = # Note: '='. // using x // x.coptions += # Note: '+='. -- cgit v1.1