diff options
Diffstat (limited to 'build2/config/module')
-rw-r--r-- | build2/config/module | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/build2/config/module b/build2/config/module index aed85a5..5becfd4 100644 --- a/build2/config/module +++ b/build2/config/module @@ -17,15 +17,39 @@ namespace build2 { namespace config { - struct module: module_base + // An ordered list of modules each with an ordered list of list of + // config.* variables and their "save flags" (see save_variable()) that + // are used (as opposed to just being specified) in this configuration. + // Populated by the config utility functions (required(), optional()) + // and saved in the order populated. + // + struct saved_variable + { + reference_wrapper<const variable> var; + uint64_t flags; + }; + + using saved_variables = vector<saved_variable>; + + struct saved_modules: butl::prefix_map<string, saved_variables, '.'> { - // A sorted list of config.* variables and their "save flags" (see - // save_variable()) that are used (as opposed to just being specified) - // in this configuration. Populated by the config utility functions - // (required(), optional()) - // - butl::prefix_map<variable_cref, uint64_t, '.'> vars; + vector<const_iterator> sequence; + + iterator + insert (string name) + { + auto p (emplace (move (name), saved_variables ())); + if (p.second) + sequence.push_back (p.first); + + return p.first; + } + }; + + struct module: module_base + { + config::saved_modules saved_modules; static const string name; }; |