From 1adbf7b710d52958f6c0168ccb492252c1f19d4a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Mar 2020 08:48:43 +0200 Subject: Cleanup and make config/utility.?xx part of build system core --- libbuild2/config/module.hxx | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'libbuild2/config/module.hxx') diff --git a/libbuild2/config/module.hxx b/libbuild2/config/module.hxx index 28c73a3..ade75cd 100644 --- a/libbuild2/config/module.hxx +++ b/libbuild2/config/module.hxx @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -51,14 +52,6 @@ namespace build2 // Priority order with INT32_MIN being the highest. Modules with the // same priority are saved in the order inserted. // - // Generally, the idea is that we want higher-level modules at the top - // of the file since that's the configuration that we usualy want to - // change. So we have the following priority bands/defaults: - // - // 101-200/150 - code generators (e.g., yacc, bison) - // 201-300/250 - compilers (e.g., C, C++), - // 301-400/350 - binutils (ar, ld) - // std::multimap order; pair @@ -82,9 +75,15 @@ namespace build2 bool save_variable (const variable&, uint64_t flags = 0); + static void + save_variable (scope&, const variable&, uint64_t); + bool save_module (const char* name, int prio = 0); + static void + save_module (scope&, const char*, int); + // Return true if the variable is already saved. // bool @@ -102,6 +101,17 @@ namespace build2 static const string name; static const uint64_t version; }; + + // Implementation-specific utilities. + // + + inline path + config_file (const scope& rs) + { + return (rs.out_path () / + rs.root_extra->build_dir / + "config." + rs.root_extra->build_ext); + } } } -- cgit v1.1