aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/module.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-13 08:48:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-13 08:58:15 +0200
commit1adbf7b710d52958f6c0168ccb492252c1f19d4a (patch)
tree04ce492fd006d3c5cf98222f923adcc9845194f4 /libbuild2/config/module.hxx
parent1dbaaa16d0ea2c6af53f16ebb14c943fdd11bac4 (diff)
Cleanup and make config/utility.?xx part of build system core
Diffstat (limited to 'libbuild2/config/module.hxx')
-rw-r--r--libbuild2/config/module.hxx26
1 files changed, 18 insertions, 8 deletions
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 <libbuild2/types.hxx>
#include <libbuild2/utility.hxx>
+#include <libbuild2/scope.hxx>
#include <libbuild2/module.hxx>
#include <libbuild2/variable.hxx>
@@ -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<std::int32_t, const_iterator> order;
pair<iterator, bool>
@@ -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);
+ }
}
}