// file : build2/config/module -*- C++ -*- // copyright : Copyright (c) 2014-2016 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #ifndef BUILD2_CONFIG_MODULE #define BUILD2_CONFIG_MODULE #include #include #include #include #include namespace build2 { namespace config { // 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 var; uint64_t flags; }; using saved_variables = vector; struct saved_modules: butl::prefix_map { vector 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; }; void boot (scope&, const location&, unique_ptr&); bool init (scope&, scope&, const location&, unique_ptr&, bool, bool, const variable_map&); } } #endif // BUILD2_CONFIG_MODULE