aboutsummaryrefslogtreecommitdiff
path: root/build2/module
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-06-26 17:05:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-06-26 17:05:07 +0200
commit5f924ea1926fe17acf699a43713b7f5881e9d30d (patch)
treeeccff3428e8a1b689e79b07088fc00b520a9485b /build2/module
parent61617d7bb990f04970c6357d8e9a9095174d8fc4 (diff)
Add support for passing configuration hints via module init()
Diffstat (limited to 'build2/module')
-rw-r--r--build2/module15
1 files changed, 12 insertions, 3 deletions
diff --git a/build2/module b/build2/module
index dcfe5d0..314f5a6 100644
--- a/build2/module
+++ b/build2/module
@@ -10,6 +10,7 @@
#include <build2/types>
#include <build2/utility>
+#include <build2/variable>
#include <build2/diagnostics>
namespace build2
@@ -40,8 +41,9 @@ namespace build2
scope& base,
const location&,
unique_ptr<module_base>&,
- bool first, // First time for this project.
- bool optional); // Loaded with 'using?' (optional module).
+ bool first, // First time for this project.
+ bool optional, // Loaded with using? (optional module).
+ const variable_map& hints); // Configuration hints (see below).
struct module_state
@@ -75,12 +77,19 @@ namespace build2
// Return true if the module was both successfully loaded and configured
// (false can only be returned if optional).
//
+ // The config_hints variable map can be used to pass configuration hints
+ // from one module to another. For example, the cxx modude may pass the
+ // target platform (which was extracted from the C++ compiler) to the bin
+ // module (which may not always be able to extract the same information from
+ // its tools).
+ //
bool
load_module (const string& name,
scope& root,
scope& base,
const location&,
- bool optional = false);
+ bool optional = false,
+ const variable_map& config_hints = variable_map ());
// Builtin modules.
//